Why authenticate not returning User object in this case?

24 views
Skip to first unread message

Chris Seberino

unread,
Apr 21, 2016, 6:20:38 PM4/21/16
to Django users
I can't seem to get authenticate to return a User object even when password is correct.

I dropped into a Django shell to recreate the problem.....

>>> js
<User: jsmith>

>>> js.username
'jsmith'

>>> js.check_password("test")
True

>>> django.contrib.auth.authenticate(username = 'jsmith', password = "test")
>>> 

WHY DIDN'T THAT WORK ???

Thanks!

Chris 

Chris Seberino

unread,
Apr 22, 2016, 10:25:27 AM4/22/16
to Django users
Solved...must add AUTHENTICATION_BACKENDS = ["django.contrib.auth.backends.ModelBackend"]
to settings.py
Reply all
Reply to author
Forward
0 new messages