authentication - authenticate of django doesnt work -


i working on password reset django, whatever try reset doesn't work. checked form handled on data knew had true. still didn't work. alst tried authenticate in django shell. , happened.

shell:

in [11]: user = user.objects.first() in [12]: password = "bier" in [13]: user.set_password(password) in [14]: = authenticate(username=user.username, password=password) in [15]: i returns none 

someone clue causing this?

you should save user object,

user.save() 

according docs, user object not saved:

"sets user’s password given raw string, taking care of password hashing. doesn’t save user object."

https://docs.djangoproject.com/en/1.8/ref/contrib/auth/#django.contrib.auth.models.user.set_password


Comments

Popular posts from this blog

c# - How can I have the VS Debugger break in the correct location for exceptions thrown in Async methods in a Console App? -

php - Issues outputting data after prepared statement with loops -

javascript - How to pass a property by reference -