what im experimenting is the next:
S:\proj>manage.py shell
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) django 1.1.1
>>> from django.contrib.auth.models import User
>>> u = User(username='luis', password='admin')
>>> u.save() #sucessfull created in mysql db
>>> from django.contrib.auth import authenticate
>>> usuario = authenticate(username='luis', password='admin')
>>> usuario
>>>
authenticate return nothing, what I am missing?
The problem is not with
authenticate, but with your creation of the user.The value stored in
u.passwordneeds to be the hashed value of the password, not the raw password itself.You can use
u.set_password('password')to take care of the hashing for you: