Skip to content

Commit

Permalink
Update docs/source/settings.rst
Browse files Browse the repository at this point in the history
Co-authored-by: Przemek Lewandowski <haxoza@users.noreply.github.com>
  • Loading branch information
tomwojcik and haxoza authored Nov 9, 2024
1 parent 81cd1e2 commit bd23a35
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/source/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down

0 comments on commit bd23a35

Please sign in to comment.