Skip to main content

django-password-policies-iplweb

Tests Docs PyPI Version Python Version License

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

IPLweb

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_required flag 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

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.

Metadata

Release files for django-password-policies-iplweb 0.9.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-password-policies-iplweb 0.9.5
File Size Uploaded Provenance Actions
django_password_policies_iplweb-0.9.5.tar.gz 100.0 kB With provenance Details for django_password_policies_iplweb-0.9.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-password-policies-iplweb 0.9.5
File Interpreter ABI Platform Actions
django_password_policies_iplweb-0.9.5-py3-none-any.whl Python 3 none any Details for django_password_policies_iplweb-0.9.5-py3-none-any.whl

Total release size: 289.1 kB

Release files / django_password_policies_iplweb-0.9.5.tar.gz

Download URL django_password_policies_iplweb-0.9.5.tar.gz
Size 100.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9ef611474c875f1c68c611acc1fd7ec8aa269e38ffb7951746041e1c99549bbc
BLAKE2b-256 checksum
How to use checksums
b7334a77d39762fffa53dcc639e70d79febc9cf05f24f42f0508897fe9bbb90a
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 Oct 24, 2026.

Transparency log

Release files / django_password_policies_iplweb-0.9.5-py3-none-any.whl

Download URL django_password_policies_iplweb-0.9.5-py3-none-any.whl
Size 189.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
31f7144b332d2adef839509d55221829585813dd3fc93791a3e827e083114cb8
BLAKE2b-256 checksum
How to use checksums
5fb2d3cb0a168982069856365fe0216e126246cb95b7843e752dccf1bf1b8abc
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 Oct 24, 2026.

Transparency log

Security for django-password-policies-iplweb 0.9.5

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for django_password_policies_iplweb-0.9.5.tar.gz

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 Oct 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page