我网站上的一位用户最近在尝试登录时成功触发了此回溯。在 Django Admin 中,他的密码为Invalid password format or unknown hashing algorithm.
我不知道是什么原因造成的。到目前为止,这是一个孤立的案例,我和其他用户已成功注册并登录该站点。
追溯
Traceback (most recent call last):
File "/home/gituser/.virtualenvs/bbox/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/var/git/bbox/userprofile/views.py", line 67, in login_view
if form.is_valid():
File "/home/gituser/.virtualenvs/bbox/lib/python2.7/site-packages/django/forms/forms.py", line 124, in is_valid
return self.is_bound and not bool(self.errors)
File "/home/gituser/.virtualenvs/bbox/lib/python2.7/site-packages/django/forms/forms.py", line 115, in _get_errors
self.full_clean()
File "/home/gituser/.virtualenvs/bbox/lib/python2.7/site-packages/django/forms/forms.py", line 271, in full_clean
self._clean_form()
File "/home/gituser/.virtualenvs/bbox/lib/python2.7/site-packages/django/forms/forms.py", line 299, in _clean_form
self.cleaned_data = self.clean()
File "/var/git/bbox/userprofile/forms.py", line 83, in clean
self.user_cache = authenticate(username=username, password=password)
File "/home/gituser/.virtualenvs/bbox/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 45, in authenticate
user = backend.authenticate(**credentials)
File "/home/gituser/.virtualenvs/bbox/lib/python2.7/site-packages/django/contrib/auth/backends.py", line 15, in authenticate
if user.check_password(password):
File "/home/gituser/.virtualenvs/bbox/lib/python2.7/site-packages/django/contrib/auth/models.py", line 304, in check_password
return check_password(raw_password, self.password, setter)
File "/home/gituser/.virtualenvs/bbox/lib/python2.7/site-packages/django/contrib/auth/hashers.py", line 42, in check_password
hasher = get_hasher(algorithm)
File "/home/gituser/.virtualenvs/bbox/lib/python2.7/site-packages/django/contrib/auth/hashers.py", line 115, in get_hasher
"setting?" % algorithm)
ValueError: Unknown password hashing algorithm ''. Did you specify it in the PASSWORD_HASHERS setting?