Django's auth.User
model uses a username
field to uniquely identify a
user. django-simple-authentication
uniquely identifies users with an
email address instead, removing the username
field altogether.
Additionally, django-simple-authentication
offers a feature that forces
users to change their password the next time they log in. This can be done
by setting simple_authentication.User.force_password_change
to True
.
The ForcePasswordChangeMiddleware
must be installed for this feature to
work properly.
- Install:
pip install django-simple-authentication
. - Add:
simple_authentication
toINSTALLED_APPS
. - Add:
AUTH_USER_MODEL = 'simple_authentication'
. - Add:
simple_authentication.middleware.ForcePasswordChanceMiddleware
toMIDDLEWARE
. - Make migrations:
python manage.py makemigrations simple_authentication
. - Apply migrations:
python manage.py migrate simple_authentication
.
django_simple_authentication
has been tested on Django versions >= 2.0.
It may work without issue on earlier versions of Django (or Python), but
this is not officially supported.
Version | Description |
---|---|
0.1.2 | Improved unit test coverage (up to 76%). |
0.1.1 | Ensure migrations are excluded from the PyPI distribution. |
0.1 | Initial version. |