PASSWORD_HASHERS setting in Django

前端 未结 2 804
既然无缘
既然无缘 2020-12-19 00:50

i have an error when ever i try to login by any User error

Unknown password hashing algorithm \'sahar\'. Did you specify it in the PASSWORD_HASHERS

2条回答
  •  忘掉有多难
    2020-12-19 01:05

    This is the best way to save log in details you can create an object from the form as

    user = form.save(commit=False)
    

    then clean the data to remove any scripts entered in the form fields.

    username = form.cleaned_data['username']
    password = form.cleaned_data['password']
    user.set_password(password)
    user.save()
    

提交回复
热议问题