Skip to main content

django-password-policies-iplweb

Tests 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")),
]

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.1.tar.gz (92.7 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.1-py3-none-any.whl (185.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_password_policies_iplweb-0.9.1.tar.gz
  • Upload date:
  • Size: 92.7 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.1.tar.gz
Algorithm Hash digest
SHA256 54e105a4d41c361476a625fd912ae42da866285d0b8e51f2f8c8f0a4a3d22aae
MD5 5c7470f8334704959be927e0efd35834
BLAKE2b-256 9347d2813ba5d9f87890d1f1748a3bf60e8d8e5f9a8698602a56e48e59212676

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_password_policies_iplweb-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 185.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a1ca3b0f1b54c39071a60d3fcf3104bcf402c579e0c9e3f68450ee6934639e46
MD5 36e06f6d3f3c03dea77be6c7e2ba00c3
BLAKE2b-256 571d2d2650aabcd5668bfa5885b3b983f8f2b1124d7a196e26ef3116158e4280

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