django-password-policies-iplweb
A Django application that provides unicode-aware password policies on password changes and resets, along with a mechanism to force password changes.
Originally developed by Tarak Blah as django-password-policies. This fork is actively maintained by IPLweb.
Support graciously provided by
Why?
Django's built-in authentication provides basic password hashing and validation, but lacks enterprise-grade password policy enforcement — expiration, reuse prevention, forced rotation, and fine-grained complexity rules. This package fills that gap with a pluggable, configurable set of policies that integrate with Django's auth system.
Features
- Password expiration — automatically expire passwords after a configurable duration (default: 60 days)
- Forced password changes — redirect users to password change form via middleware, with admin bulk action support
- Password history — prevent reuse of the last N passwords (default: 10)
- 11 built-in validators — letter/number/symbol counts, consecutive character limits, common sequence detection, entropy checks, dictionary lookup, cracklib support, email rejection
- Password similarity check — Levenshtein distance comparison between old and new passwords
- Complete password change/reset views — six class-based views with customizable templates and URLs
- Django admin integration — admin panels for password history and forced change management
- 26 configurable settings — fine-tune every aspect of password policy enforcement
- Context processor — exposes
password_change_requiredflag to templates - Unicode-aware — full unicode support in password validation
- I18N ready — all user-facing messages use Django's translation framework
Supported versions
| Django \ Python | 3.10 | 3.11 | 3.12 | 3.13 |
|---|---|---|---|---|
| 4.2 LTS | ✓ | ✓ | ✓ | ✗ |
| 5.2 LTS | ✓ | ✓ | ✓ | ✓ |
| 6.0 | ✗ | ✗ | ✓ | ✓ |
| 6.1 | ✗ | ✗ | ✓ | ✓ |
Django 6.x requires Python 3.12 or newer.
Django 5.0 and 5.1 are no longer covered by CI (both reached end of life upstream),
but the package does not use any API removed in those series and the declared
dependency is still django>=4.2, so they keep working.
Installation
Using uv (recommended)
uv add django-password-policies-iplweb
Using pip
pip install django-password-policies-iplweb
Quick start
Add to your Django settings:
INSTALLED_APPS = [
...
"password_policies",
]
MIDDLEWARE = [
...
"password_policies.middleware.PasswordChangeMiddleware",
]
TEMPLATES = [
{
...
"OPTIONS": {
"context_processors": [
...
"password_policies.context_processors.password_status",
],
},
},
]
Run migrations:
python manage.py migrate password_policies
Include URLs:
from django.urls import include, path
urlpatterns = [
...
path("password/", include("password_policies.urls")),
]
Documentation
Full documentation is published at
https://iplweb.github.io/django-password-policies-iplweb/ and rebuilt from
develop on every push.
To build the docs locally:
uv sync --all-extras
uv run sphinx-build -b html docs docs/_build/html
License
BSD-3-Clause — see LICENSE for details.
Release files for django-password-policies-iplweb 0.9.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_password_policies_iplweb-0.9.4.tar.gz | 98.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_password_policies_iplweb-0.9.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 287.4 kB
Release files / django_password_policies_iplweb-0.9.4.tar.gz
| Download URL | django_password_policies_iplweb-0.9.4.tar.gz |
|---|---|
| Size | 98.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e2c02f7f288db169af93574b30117eaccc61e9f7ddab5989254f30230de31c47
|
|
BLAKE2b-256 checksum How to use checksums |
b284b8f652879a3913ca1555f023e8b3912c862e48fd7a00721924778037d3f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.
Transparency logRelease files / django_password_policies_iplweb-0.9.4-py3-none-any.whl
| Download URL | django_password_policies_iplweb-0.9.4-py3-none-any.whl |
|---|---|
| Size | 188.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f45efc494fb407182865957965e3677dfd00248210da5c7b4e8e5e848a6ae89a
|
|
BLAKE2b-256 checksum How to use checksums |
af003887ed604d6693aff3c87901616f5b1fcbe93cf8a4ddb81bff30c24a7a37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.
Transparency log