Django app for forcing password expiration
Project description
Django password expiration app
This app provides configurable expiration of passwords.
Features
- Configurable password duration and warning duration
- Visual warning to user using Django messages
- Prevents user from logging in after expiration
Requirements
This Django app requires Python >= 3.6 and has been tested with Django 2.2, 3.1, and 3.2.
Installation
pip install django-password-expire
.- Add
password_expire
toINSTALLED_APPS
. - Add
'password_expire.middleware.PasswordExpireMiddleware'
toMIDDLEWARE
. It should be listed after authentication and session middlewares. - Configure the app in your settings:
# contact information if password is expired PASSWORD_EXPIRE_CONTACT = "John Doe <jdoe@example.com>" # expire passwords after 90 days PASSWORD_EXPIRE_SECONDS = 90 * 24 * 60 * 60 # start warning 10 days before expiration PASSWORD_EXPIRE_WARN_SECONDS = 10 * 24 * 60 * 60
- Run
python manage.py migrate
to create the required database tables.
To redirect new users to the change password page, set this flag in the settings:
PASSWORD_EXPIRE_FORCE = True
If you want to exclude superusers from the password expiration, set this flag:
PASSWORD_EXPIRE_EXCLUDE_SUPERUSERS = True
Acknowledgements
This app is inspired by django-password-policies-iplweb.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django-password-expire-0.2.tar.gz
.
File metadata
- Download URL: django-password-expire-0.2.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 280e04ac0f1110848e24ea46b9571fb6c62ea0995018364121c52e6fb05a7dd6 |
|
MD5 | 1f568a5e71a1f80d3b790e56718428c0 |
|
BLAKE2b-256 | 60818c2bf4dd14024c0a15338786bd77bb39c5653675216fc12fd6fb4c3d6c6d |
File details
Details for the file django_password_expire-0.2-py3-none-any.whl
.
File metadata
- Download URL: django_password_expire-0.2-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d93e656a22b612161316e1db11c58740857f3b61e317febe71eaa06a36be97f |
|
MD5 | bd99265a99f1ad1265265721b0c8f1e5 |
|
BLAKE2b-256 | ec5c156b382d92d1a8d1cfd1b9fb35f2380edec265a10c33b0151fe8e560fdb3 |