django-rest-auth/docs/configuration.rst

34 lines
1.5 KiB
ReStructuredText
Raw Normal View History

2014-10-09 15:01:47 +04:00
Configuration
=============
2014-10-09 16:53:39 +04:00
- **REST_AUTH_SERIALIZERS**
2014-10-09 15:01:47 +04:00
2014-10-09 16:53:39 +04:00
You can define your custom serializers for each endpoint without overriding urls and views by adding ``REST_AUTH_SERIALIZERS`` dictionary in your django settings.
Possible key values:
2014-10-09 15:01:47 +04:00
2014-10-09 16:53:39 +04:00
- LOGIN_SERIALIZER - serializer class in ``rest_auth.views.Login``, default value ``rest_auth.serializers.LoginSerializer``
2014-10-09 15:01:47 +04:00
2014-10-09 16:53:39 +04:00
- TOKEN_SERIALIZER - response for successful authentication in ``rest_auth.views.Login``, default value ``rest_auth.serializers.TokenSerializer``
2014-10-09 15:01:47 +04:00
2014-10-09 16:53:39 +04:00
- USER_DETAILS_SERIALIZER - serializer class in ``rest_auth.views.UserDetails``, default value ``rest_auth.serializers.UserDetailsSerializer``
2014-10-09 15:01:47 +04:00
2014-10-09 16:53:39 +04:00
- PASSWORD_RESET_SERIALIZER - serializer class in ``rest_auth.views.PasswordReset``, default value ``rest_auth.serializers.PasswordResetSerializer``
2014-10-09 15:01:47 +04:00
2014-10-09 16:53:39 +04:00
- PASSWORD_RESET_CONFIRM_SERIALIZER - serializer class in ``rest_auth.views.PasswordResetConfirm``, default value ``rest_auth.serializers.PasswordResetConfirmSerializer``
2014-10-09 15:01:47 +04:00
2014-10-09 16:53:39 +04:00
- PASSWORD_CHANGE_SERIALIZER - serializer class in ``rest_auth.views.PasswordChange``, default value ``rest_auth.serializers.PasswordChangeSerializer``
2014-10-09 15:01:47 +04:00
2014-10-09 16:53:39 +04:00
Example configuration:
2014-10-09 15:01:47 +04:00
2014-10-09 16:53:39 +04:00
.. code-block:: python
2014-10-09 15:01:47 +04:00
2014-10-09 16:53:39 +04:00
REST_AUTH_SERIALIZERS = {
'LOGIN_SERIALIZER': 'path.to.custom.LoginSerializer',
'TOKEN_SERIALIZER': 'path.to.custom.TokenSerializer',
...
}
- **REST_SESSION_LOGIN** - Enable session login in Login API view (default: True)