Fixed #19662 -- alter auth modelbackend to accept custom username fields

Thanks to Aymeric and Carl for the review.
This commit is contained in:
Preston Holmes 2013-02-06 14:25:51 -08:00
parent 112c6e987d
commit c44d748272
3 changed files with 31 additions and 7 deletions

View file

@ -412,9 +412,15 @@ The following backends are available in :mod:`django.contrib.auth.backends`:
.. class:: ModelBackend
This is the default authentication backend used by Django. It
authenticates using usernames and passwords stored in the
:class:`~django.contrib.auth.models.User` model.
authenticates using credentials consisting of a user identifier and
password. For Django's default user model, the user identifier is the
username, for custom user models it is the field specified by
USERNAME_FIELD (see :doc:`Customizing Users and authentication
</topics/auth/customizing>`).
It also handles the default permissions model as defined for
:class:`~django.contrib.auth.models.User` and
:class:`~django.contrib.auth.models.PermissionsMixin`.
.. class:: RemoteUserBackend