Utilities and fields that validate usernames during registration. Useful for Django projects that allow public user registration.
The full documentation is at https://django-username-tools.readthedocs.io.
See Installation for instructions.
See Usage for usage info.
- Validates using a blacklist of usernames. Comes with a default set of blacklisted usernames taken from the-big-username-blacklist project
- A ready-to-use UsernameModelField for custom user models and UsernameFormField for user registration form.
- Readable source code with 100% test coverage.
- Add email username field
- A default blacklist of disposable email domains
- API docs for modules, classes and functions
Using database to store blacklisted username has several advantages. I belive that a blacklist of usernames should be treated like any other data in the project.
- The list can be updated dynamically from code or by using the django admin.
- The list can vary depending on different factors such as locality, and the scope of project etc.
- Database backend allows more sophisticated lookups that we can leverage if required.
Clone the repository. If you use pipenv, which I highly recommend, run the following commands:
pipenv install -d pipenv run ./runtests.py
If you don't use pipenv, run the following commands:
source <YOURVIRTUALENV>/bin/activate (myenv) $ pip install -r requirements_dev.txt (myenv) $ python runtests.py
Tools used in rendering this package: