0
我有一個數據庫用戶名和密碼(純文本),現在我必須創建一個登錄應用程序,所以我需要一個最好的方式,我如何創建一個登錄可以使用Django註冊或任何登錄其他Django的默認應用程序,從而使我的工作容易我已經試過是:用普通密碼登錄Django
我創造了一個重復表,並試圖將其與此代碼加密,但它沒有工作
import crypt
# To encrypt the password. This creates a password hash with a random salt.
password_hash = crypt.crypt(password)
# To check the password.
valid_password = crypt.crypt(cleartext, password_hash) == password_hash
需要更多的細節,你的意思'沒有work' –
如何https://docs.djangoproject.com/en/1.11/ref/contrib/auth/#django.contrib.auth.models。 User.set_password –