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

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -