Skip to main content

A Django reusable app that provides validators and a form field that checks the strength of a password

Project description

django-passwords is a reusable app that provides a form field and validators that check the strength of a password.

Installation

You can install django-passwords with pip by typing:

pip install django-passwords

Or with easy_install by typing:

easy_install django-passwords

Or manually by downloading a tarball and typing:

python setup.py install

Settings

django-passwords adds 6 optional settings

Optional:

Specifies minimum length for passwords:

PASSWORD_MIN_LENGTH = 6 # Defaults to 6

Specifies maximum length for passwords:

PASSWORD_MAX_LENGTH = 120 # Defaults to None

Specifies the location of a dictionary (file with one word per line):

PASSWORD_DICTIONARY = "/usr/share/dict/words" # Defaults to None

Specifies how close a fuzzy match has to be to be considered a match:

PASSWORD_MATCH_THRESHOLD = 0.9 # Defaults to 0.9, should be 0.0 - 1.0 where 1.0 means exactly the same.

Specifies a list of common sequences to attempt to match a password against:

PASSWORD_COMMON_SEQUENCES = [] # Should be a list of strings, see passwords/validators.py for default

Specifies number of characters within various sets that a password must contain:

PASSWORD_COMPLEXITY = { # You can ommit any or all of these for no limit for that particular set
    "UPPER": 1,       # Uppercase
    "LOWER": 1,       # Lowercase
    "DIGITS": 1,      # Digits
    "PUNCTUATION": 1, # Punctuation (string.punctuation)
    "NON ASCII": 1,   # Non Ascii (ord() >= 128)
    "WORDS": 1        # Words (substrings seperates by a whitespace)
}

Usage

To use the formfield simply import it and use it:

from django import forms
from passwords.fields import PasswordField

class ExampleForm(forms.Form):
    password = PasswordField(label="Password")

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

django-passwords-0.2.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

django_passwords-0.2.0-py2.7.egg (13.5 kB view details)

Uploaded Source

File details

Details for the file django-passwords-0.2.0.tar.gz.

File metadata

File hashes

Hashes for django-passwords-0.2.0.tar.gz
Algorithm Hash digest
SHA256 aac0a4607d1dab2e3d3563d92a79d29d6f1326a87c176d4b8e853316a36085b1
MD5 3c83f4ee9ace78c46bf9d873e4cda35b
BLAKE2b-256 5a712a3d99450b807985e5c9e9ffcd047b1b4519c18776741d1ca18769d3ab65

See more details on using hashes here.

Provenance

File details

Details for the file django_passwords-0.2.0-py2.7.egg.

File metadata

File hashes

Hashes for django_passwords-0.2.0-py2.7.egg
Algorithm Hash digest
SHA256 399522f7a48ab009dcc530faf4385c4d54cf60f69a84cfe40eeb13b6a50bba49
MD5 644edf69efbb6856fa7e549b461c6a02
BLAKE2b-256 c00b5ae47d131d624316622bdae2574c204701eba126a418a4bd1438cc8dd978

See more details on using hashes here.

Provenance

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