I am having trouble getting the Django authenticate function to work the way I expect. When I create a new user and try to authenticate in the manner described in the documentation, the authenticate() function returns None. I have seen many posts about "authenticate not working", but none of the solutions work for me. Here is a demonstration:
In [34]: user = User.objects.create(username='fakeuser', email='[email protected]', password='abc') In [35]: user Out[35]: <User: fakeuser> In [39]: auth_user = authenticate(username='fakeuser', password='abc') In [40]: print(auth_user) None It is my understanding that authenticate() in this case should return an object that I can then pass to the login() function to log the user in, but I get None instead. What am I doing wrong?