django-yeouia

A Django auth backend that works with email or username


License
BSD-3-Clause
Install
pip install django-yeouia==2.0.0

Documentation

Yummy Email Or Username Insensitive Auth model backend for Django

PyPI version Tests pre-commit.ci status codecov Maintainability Code style: black

Instructions

  1. pip install yeouia
  2. Add AUTHENTICATION_BACKENDS = ['yeouia.backends.YummyEmailOrUsernameInsensitiveAuth'] to your settings.py
  3. Enjoy

Requirements

Tested for

  • Python 3.8, 3.9, 3.10
  • Django 2.2+

May work otherwise, but you should run tests :P

Case Insensitive ?

Django's default auth username is not case insensitive. (See #2273 and #25617)

But… Who cares ?

This backend tries:

  1. username, case sensitive
  2. username, case insensitive
  3. email, case insensitive

And follows #20760.