4👍
Okay, after some digging around, I found out that the solution was fairly simple. The line
File "e:\venvs\django_tutorial_venv\lib\site-packages\django\contrib\auth\password_validation.py", line 29, in get_password_validators
raise ImproperlyConfigured(msg % validator['NAME'])
django.core.exceptions.ImproperlyConfigured: The module in NAME could not be imported: django.contrib.auth.password_validation. UserAttributeSimilarityValidator. Check your AUTH_PASSWORD_VALIDATORS setting.
is faulty, specifically, I conformed to the pep8 standard and I mistakenly added spaces in front of UserAttributeSimilarityValidator
, so it read the full string with spaces included, that’s why it couldn’t find the package. I corrected the strings, ignoring pep8 and it worked.
9👍
To add more detailed answer on @Elnherjar ‘s answer,
on your settings.py
don’t do
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.\
UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.\
MinimumLengthValidator',
},
...
]
which appends a tab in those strings. A cleaner approach can be,
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.' +
'UserAttributeSimilarityValidator',
},
...
]
- [Django]-Searching for a project skeleton for Chef + Django on Linux
- [Django]-How to use date__range filter efficiently in django
2👍
Following line of code in settings resolved the issue.
AUTH_PWD_MODULE="django.contrib.auth.password_validation."
AUTH_PASSWORD_VALIDATORS = [
{
"NAME": f"{AUTH_PWD_MODULE}UserAttributeSimilarityValidator",
},
{
"NAME": f"{AUTH_PWD_MODULE}MinimumLengthValidator",
},
{
"NAME": f"{AUTH_PWD_MODULE}CommonPasswordValidator",
},
{
"NAME": f"{AUTH_PWD_MODULE}NumericPasswordValidator",
},
]
I found it more readable. The actual issue is when try format string using \, the name is changed.
- [Django]-Django – WSGI script cannot be loaded as Python module
- [Django]-Django-CMS AppHooks with conflicting urls?
1👍
following your traceback you might need to Look at your settings and look for AUTH_PASSWORD_VALIDATORS, there may be some syntax error
- [Django]-Django: two sessions in the same browser
- [Django]-How to use SearchHeadline with SearchVector on multiple fields
- [Django]-Django Admin Remove default save message
- [Django]-Force reload on client's webpage Django
- [Django]-Django app with fcgi works only in non daemonized mode