Registry / web-framework / django-zxcvbn-password-validator

django-zxcvbn-password-validator

JSON →
library1.6.0pypypi✓ verified 81d ago

A Django password validator that integrates zxcvbn-python to enforce password strength checks with translatable feedback. Current version 1.6.0, supports Python >=3.6 and Django 2.2+. Maintained on GitHub by pych卉.

pip install django-zxcvbn-password-validator
INSTALL
IMPORT
SIG · DJANGO-ZXCVBN-PASS
D
django-zxcvbn-password-validator
web-frameworkpythonv1.6.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ZxcvbnPasswordValidator
from django_zxcvbn_password_validator import ZxcvbnPasswordValidator
from django_zxcvbn_password_validator import ZXCVBNValidator

Add the validator to AUTH_PASSWORD_VALIDATORS in Django settings.

# settings.py AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django_zxcvbn_password_validator.ZXCVBNValidator', 'OPTIONS': { 'min_score': 3, 'user_attributes': ('username', 'email', 'first_name', 'last_name') } } ]
Debug
Known issues
gotchaThe library is not compatible with Django >=3.2 if you rely on the old password validators format? Actually it works with Django 2.2+ but check your Django version for generic validators support.
fix
Use the validator class path as 'django_zxcvbn_password_validator.ZXCVBNValidator'.
affects: >=1.0.0
deprecatedDefining validators via list of strings is deprecated in Django 4.x; use the new tuple format or classes. This library works with the string path format in current versions.
fix
If using Django 4.x, consider switching to the class-based definition: ZXCVBNValidator(min_score=3, user_attributes=(...))
affects: Django 4.x+ with strict settings
gotchaThe 'user_attributes' option uses Django's User model fields by default; if you have custom user model, provide the actual field names; missing attributes can cause AttributeError.
fix
Ensure custom user model has the fields listed, or omit user_attributes entirely.
affects: all
Upgrade
Version history
1.6.0latest on PyPI · released Mar 24, 2026
Audit
Dependencies
djangorequiredRequired for validation framework
zxcvbn-pythonrequiredBackend strength estimation
Agent activity
17 hits · last 30 days
node
16
OpenAI (training)
1
Resources
django-zxcvbn-password-validator — pip install django-zxcvbn-password-validator · libregistry