password: add Django password validators

Added all default Django password validators.

Not enforcing special characters.
https://blog.codinghorror.com/password-rules-are-bullshit/

Signed-off-by: Joseph Nuthalpati <njoseph@thoughtworks.com>

Reviewed-by: Johannes Keyser <johanneskeyser@posteo.de>
This commit is contained in:
Joseph Nuthalpati 2017-09-05 14:59:56 +05:30 committed by Johannes Keyser
parent fbe08443f4
commit 2e73d442e9
No known key found for this signature in database
GPG Key ID: D1431C2C533CF0D0

View File

@ -218,6 +218,23 @@ def configure_django():
django.conf.settings.configure(
ALLOWED_HOSTS=['*'],
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
'OPTIONS': {
'min_length': 8,
}
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
],
CACHES={'default':
{'BACKEND': 'django.core.cache.backends.dummy.DummyCache'}},
DATABASES={'default':