Forcing user to make strong password always a good practice. But for making a simple web application, too much restriction in password may caused loose interest user from creating account.
Withdraw all restriction by add this line in settings.py
file
AUTH_PASSWORD_VALIDATORS = []
If we want user has to put at least 8 characters we can do that by
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
'OPTIONS': {
'min_length': 8,
}
},
]
Here is all possible choice to make restricted in user password
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
'OPTIONS': {
'min_length': 9,
}
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
Top comments (1)
Perfect!