django-hibpwned

Django password validator based on haveibeenpwned.com API


Keywords
django, haveibeenpawned, password-validator
License
MIT
Install
pip install django-hibpwned==0.2

Documentation

django-hibpwned

Django (>=1.9) password validator based on haveibeenpwned.com API

Requirements

Python 3.5+
Django 1.9+
requests 2+

Usage:

Add to settings.py:

AUTH_PASSWORD_VALIDATORS = [
    (...)
    {
        'NAME': 'haveibeenpwned.validators.HaveIBeenPwnedValidator'
    },
]

reference

Tests

To run the test suite create and activate a virtual environment. Then install some requirements and run the tests:

$ cd tests
$ pip install -e ..
$ ./runtests.py

Credits:

  1. Troy Hunt
  2. HaveIBeenPwned.com
  3. Django
  4. Requests