A Django library to check passwords against the Have I Been Pwned Pwned Passwords database, either via k-Anonymity API or a local download of the hashed passwords. Version 5.2.0 requires Python >=3.9, compatible with Django 3.2+. It integrates seamlessly with Django's password validation framework and provides both online and offline modes.
pip install pwned-passwords-djangoVerified import paths — ran on the pinned version, not inferred.
Basic setup: add app to INSTALLED_APPS, add the validator, and optionally configure API vs local mode.
Use set_password() or User.objects.create_user() to ensure validation runs.
Set PWNED_PASSWORDS['API_ENABLED'] = False and use a local database download for offline mode.
Use the new package name: pip install pwned-passwords-django. Old import 'from pwned_passwords import ...' no longer works.