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

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_password_policies_iplweb-0.9.3.tar.gz (95.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_password_policies_iplweb-0.9.3-py3-none-any.whl (187.4 kB view details)

Uploaded Python 3

File details

Details for the file django_password_policies_iplweb-0.9.3.tar.gz.

File metadata

  • Download URL: django_password_policies_iplweb-0.9.3.tar.gz
  • Upload date:
  • Size: 95.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for django_password_policies_iplweb-0.9.3.tar.gz
Algorithm Hash digest
SHA256 3e4a804d31c8ce1ee9857811d109b00410cac7e2e4670edf898f143a0e8e45d2
MD5 b9ca8601af1d54559e07d68bc3b70c76
BLAKE2b-256 ac28490be729a5d4088c2fb81bf35cc6a49b66a9f3c3e882a53b4596ac9de16f

See more details on using hashes here.

File details

Details for the file django_password_policies_iplweb-0.9.3-py3-none-any.whl.

File metadata

  • Download URL: django_password_policies_iplweb-0.9.3-py3-none-any.whl
  • Upload date:
  • Size: 187.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for django_password_policies_iplweb-0.9.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b1fa4169ce3e2b433fa43461e2c8cc0c18f41c43a092a8be66d1935686708998
MD5 a85c53716d720ef70d42ddc3fb03e084
BLAKE2b-256 4c9d77c3a6ae586012ef38371021b2ba459d7d28fc0b460329bedba3fccfe2ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page