我的網站上的其中一位用戶最近設法在嘗試登錄時觸發此追蹤。在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?
着Django的版本您使用的?我的第一個猜測是密碼存儲字符串以某種方式被破壞,因爲它以固定格式存儲。 – jhonkola
可能重複w/http://stackoverflow.com/questions/10246463/password-hashers-setting-in-django/10246947#10246947 – okm
@okm嗯我認爲這可能是相關的,但事情是,它是迄今爲止一直是孤立的案件。其他新用戶已成功註冊並登錄後,這傢伙..任何想法? – super9