django-authtools provides two authentication backend classes. These backends offer more customization for authentication.
Enables case-insensitive logins for the User model. It works by simply lowercasing usernames before trying to authenticate.
There is also a
CaseInsensitiveUsernameFieldBackendMixinif you need more flexibility.
To use this backend class, add it to your settings:
# settings.py AUTHENTICATION_BACKENDS = [ 'authtools.backends.CaseInsensitiveUsernameFieldModelBackend', ]
Use of this mixin assumes that all usernames are stored in their lowercase form, and that there is no way to have usernames differing only in case. If usernames can differ in case, this authentication backend mixin could cause errors in user authentication. It is advised that you use this mixin in conjuction with the
Mixin enabling case-insensitive logins.