使用这个库,https://github.com/jmoswalt/wp-to-django-users
基本上你添加的Django的能力重新哈希旧WordPress的密码,让您的老WordPress用户现在可以在新的Django的网站使用他们的相同&旧密码
在你的Django项目的settings.py文件,添加以下内容:
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',
'hashers_passlib.phpass',
)
然后重新哈希密码,和你做。
from django.contrib.auth.hashers import get_hasher
hasher = get_hasher('phpass')
user.password = hasher.from_orig(user.password)
我真的很希望你没有权限访问你的用户的纯文本密码......并且发现wordpress的哈希算法不需要比简单的谷歌搜索更多的努力。 –
可能的重复[WordPress使用什么类型的散列?](http://stackoverflow.com/questions/1045988/what-type-of-hash-does-wordpress-use) –
如果你看看一些他们可能会告诉你使用了什么:算法$ rounds $ hash $ salt – jonrsharpe