I really miss what is happening here. Django 1.3.
Symptom: Authentication is just overloaded. I reduced the problem to this:
./manage.py shell Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>>from django.contrib.auth.models import User >>> users = User.objects.all() >>> users [<User: jal>] >>> users[0].set_password('whatever'); >>> users[0].save() >>> user = auth.authenticate(username="jal", password="whatever") >>> print user None
I am in difficulty.
Edit:
>>> from django.contrib.auth.models import User >>> user = User.objects.get(username="jal") >>> print user jal >>> user.check_password('whatever') False
I am using django.contrib.auth.backends.ModelBackend.
Edit two:
>>> print user jal >>> print user.is_active True
Edit three:
Alasdair is right - thanks.
>>> users = User.objects.all() >>> user = users[0] >>> user.set_password('whatever') >>> user.save() >>> u2 = auth.authenticate(username="jal", password="whatever") >>> print u2 jal
This still leaves a secret as to why it has been violated for actual access to the Django admin GUI, and that is why I led this road in the first place. This gives me “Please enter a valid username and password. Please note that both fields are case sensitive” is the password correct.
source share