diff --git a/docs/source/settings.rst b/docs/source/settings.rst index eeb668aa..6c3f3edb 100644 --- a/docs/source/settings.rst +++ b/docs/source/settings.rst @@ -41,6 +41,15 @@ for this setting to work as expected. If you don't want to roll out your own authentication backend, ``LoginFieldBackend`` has been prepared. It works the same as ``ModelBackend``, but it is using ``LOGIN_FIELD`` instead of ``User.USERNAME_FIELD``. +To make your code backward compatible with previous Djoser versions, add this auth backend to your Django settings: + +.. code-block:: python + + AUTHENTICATION_BACKENDS = [ + "djoser.auth_backends.LoginFieldBackend", + ] + +Please notice that it is not recommended way of authentication and it may be removed in the future Djoser versions. **Default**: ``User.USERNAME_FIELD`` where ``User`` is the model set with Django's setting AUTH_USER_MODEL. .. warning::