Allows authentication with either a username or an email address.
This package allows to authenticate a user with either a username an email address, or both. It overrides Django authenticate method, so it should work in almost any case of use, without touch anything else. For support and aditional documentation, in case you need it, please visit our Github repository .
pip install django-dual-authentication
Then, add this line to your settings.py:
AUTHENTICATION_BACKENDS = ['django-dual-authentication.backends.DualAuthentication']
We’ve been reported about users having problems with MySQL and dual-authentication case sensitive option. This is because mysql is case-insensitive by default. So, if you need case sensitive authentication, probably you’d prefer avoid this database engine.
Also, note that if you combine certain options like AUTHENTICATION_METHOD = 'username' and AUTHENTICATION_CASE_SENSITIVE = 'username', then might be a good idea check if a not case sensitive user already exists, for your registation form’s username field. Other way, users having the same username with different capital letters, will not be able to login, for obvious reasons.