Django登录失败,ValueError:原因未知

Django登录失败,ValueError:原因未知,django,django-admin,django-authentication,pycrypto,django-login,Django,Django Admin,Django Authentication,Pycrypto,Django Login,我在尝试登录时遇到一个奇怪的错误。登录到管理员时也会发生这种情况 ValueError:原因未知 堆栈跟踪位于 基本上,crypto.py中的这一行失败了 return hashlib.pbkdf2_hmac( digest().name, password, salt, iterations, dklen) 这是在Django-1.9.5和RHEL 5.3上的Python2.7.9中出现的,我在centos 5.8和Python2.7.12中遇到了同样的问题,我在Dj

我在尝试登录时遇到一个奇怪的错误。登录到管理员时也会发生这种情况

ValueError:原因未知

堆栈跟踪位于

基本上,crypto.py中的这一行失败了

return hashlib.pbkdf2_hmac(
            digest().name, password, salt, iterations, dklen)

这是在Django-1.9.5和RHEL 5.3上的Python2.7.9中出现的,我在centos 5.8和Python2.7.12中遇到了同样的问题,我在Django设置中添加了更改密码哈希器

默认情况下,它是:

PASSWORD_HASHERS = [
    'django.contrib.auth.hashers.PBKDF2PasswordHasher',
    'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
    'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
    'django.contrib.auth.hashers.BCryptPasswordHasher',
    'django.contrib.auth.hashers.SHA1PasswordHasher',
    'django.contrib.auth.hashers.MD5PasswordHasher',
    'django.contrib.auth.hashers.CryptPasswordHasher',
]
我把它改成:

PASSWORD_HASHERS = [
    'django.contrib.auth.hashers.MD5PasswordHasher',
    'django.contrib.auth.hashers.PBKDF2PasswordHasher',
    'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
    'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
    'django.contrib.auth.hashers.BCryptPasswordHasher',
    'django.contrib.auth.hashers.SHA1PasswordHasher',
    'django.contrib.auth.hashers.CryptPasswordHasher',
]

我认为使用MD5不够好,所以我正在寻找可能缺少的系统库。您还需要创建新用户或超级用户,因为您已经创建了一些用户,他们的密码没有正确的加密。

我在centos 5.8和python 2.7.12上遇到了同样的问题,我在django设置中添加了更改密码哈希器

默认情况下,它是:

PASSWORD_HASHERS = [
    'django.contrib.auth.hashers.PBKDF2PasswordHasher',
    'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
    'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
    'django.contrib.auth.hashers.BCryptPasswordHasher',
    'django.contrib.auth.hashers.SHA1PasswordHasher',
    'django.contrib.auth.hashers.MD5PasswordHasher',
    'django.contrib.auth.hashers.CryptPasswordHasher',
]
我把它改成:

PASSWORD_HASHERS = [
    'django.contrib.auth.hashers.MD5PasswordHasher',
    'django.contrib.auth.hashers.PBKDF2PasswordHasher',
    'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
    'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
    'django.contrib.auth.hashers.BCryptPasswordHasher',
    'django.contrib.auth.hashers.SHA1PasswordHasher',
    'django.contrib.auth.hashers.CryptPasswordHasher',
]
我认为使用MD5不够好,所以我正在寻找可能缺少的系统库。您还需要创建新用户或超级用户,因为您已经创建了一些用户,他们的密码将没有正确的加密