Skip to main content

Extends Django password validation options in an attempt to keep up with industry standards for strong user passwords.

Project description

django_advanced_password_validation

test Coverage Status

Extends Django password validation options to include minimum uppercase, minimum lowercase, minimum numerical, and minimum special characters. This was created in an attempt to keep up with industry standards for strong user passwords.

This package has been tested with python 3.9+.

Prerequisites

Requires Django 3.2 or later. You can install the latest version of Django via pip:

pip install django

Alternatively, you can install a specific version of Django via pip:

pip install django=3.2

NOTE: See the django-project documentation for information on non-deprecated Django versions.

Installation

Normal installation

Install django_advanced_password_validation via pip:

pip install django_advanced_password_validation

Development installation

git clone https://github.com/ezrajrice/django_advanced_password_validation.git
cd django_advanced_password_validation
pip install --editable .

Usage

The optional validators must be configured in the settings.py file of your django project to be actively used in your project.

/my-cool-project/settings.py

INSTALLED_APPS = [
    ...
    'django_advanced_password_validation',
    ...
]

AUTH_PASSWORD_VALIDATORS = [
    ...
    {
        'NAME': 'django_advanced_password_validation.advanced_password_validation.ContainsDigitsValidator',
        'OPTIONS': {
            'min_digits': 1
        }
    },
    {
        'NAME': 'django_advanced_password_validation.advanced_password_validation.ContainsUppercaseValidator',
        'OPTIONS': {
            'min_uppercase': 1
        }
    },
    {
        'NAME': 'django_advanced_password_validation.advanced_password_validation.ContainsLowercaseValidator',
        'OPTIONS': {
            'min_lowercase': 1
        }
    },
    {
        'NAME': 'django_advanced_password_validation.advanced_password_validation.ContainsSpecialCharactersValidator',
        'OPTIONS': {
            'min_characters': 1
        }
    },
    ...
]

Options

Here is a list of the available options with their default values.

Validator Option Default
ContainsDigitsValidator min_digits 1
ContainsUppercaseValidator min_uppercase 1
ContainsLowercaseValidator min_lowercase 1
ContainsSpecialCharactersValidator min_characters 1
MaximumLengthValidator max_length 128
MaxConsecutiveCharactersValidator max_consecutive 3
ConsecutivelyIncreasingDigitValidator max_consecutive 3
ConsecutivelyDecreasingDigitValidator max_consecutive 3

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgments

  • Victor Semionov - Contributor - vsemionov
  • Mostafa Moradian - Contributor - mostafa

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

File details

Details for the file django_advanced_password_validation-1.2.0.tar.gz.

File metadata

File hashes

Hashes for django_advanced_password_validation-1.2.0.tar.gz
Algorithm Hash digest
SHA256 632b068e8bc0a428e18c8ae5e3ba2a104829ce905bda91772998c65256440a38
MD5 f99b990564bb2909374f0b25088e2c51
BLAKE2b-256 573a95cfa70cab92eb2024dbf34066b2ef4053ea37b40cee1a5bf335c025826c

See more details on using hashes here.

File details

Details for the file django_advanced_password_validation-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_advanced_password_validation-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5ae2538099eda910791000efcd971bcc7c1e9eefbf5d466a94afe9b1f9de188c
MD5 ba3cfd832b8d0d16a4b61b985244682e
BLAKE2b-256 13b2f704097638fc4253b9c983881c3f009a78a1f17af9ad496ad0b4c5f562d7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page