Задать вопрос

Тел: +7 965 3737 888

534

Просмотров

2

Ответов

Login with email or username

<p>A simple backend which allows you to login with either an email address or a username.</p>
<p>It should be combined with another backend for checking permissions:</p>
AUTHENTICATION_BACKENDS = (
    'myproject.accounts.backends.EmailOrUsernameModelBackend',
    'django.contrib.auth.backends.ModelBackend'
)

Вопрос полезен? Да0/Нет0
file_4622.py(669.0б)
None

Ответы (2):

Ответnhammond:14.10.2014
Ответ полезен? Да0/Нет0

If you want to do this, be sure to forbid the '@' character in usernames. Otherwise some serious problems can arise.

Ответwozozo:14.05.2010
Ответ полезен? Да0/Нет0

thanks!