Note that there are some explanatory texts on larger screens.

plurals
  1. PODjango auth failure
    primarykey
    data
    text
    <p>I'm really missing what is going on here. Django 1.3.</p> <p>Symptom: the Authentication is simply busted. I've reduced the problem to this:</p> <pre><code>./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) &gt;&gt;&gt;from django.contrib.auth.models import User &gt;&gt;&gt; users = User.objects.all() &gt;&gt;&gt; users [&lt;User: jal&gt;] &gt;&gt;&gt; users[0].set_password('whatever'); &gt;&gt;&gt; users[0].save() &gt;&gt;&gt; user = auth.authenticate(username="jal", password="whatever") &gt;&gt;&gt; print user None </code></pre> <p>I'm at a loss on this.</p> <p>Edit: </p> <pre><code>&gt;&gt;&gt; from django.contrib.auth.models import User &gt;&gt;&gt; user = User.objects.get(username="jal") &gt;&gt;&gt; print user jal &gt;&gt;&gt; user.check_password('whatever') False </code></pre> <p>I'm using the django.contrib.auth.backends.ModelBackend .</p> <p>Edit two: </p> <pre><code>&gt;&gt;&gt; print user jal &gt;&gt;&gt; print user.is_active True </code></pre> <p>Edit three: </p> <p>Alasdair is right - thank you.</p> <pre><code>&gt;&gt;&gt; users = User.objects.all() &gt;&gt;&gt; user = users[0] &gt;&gt;&gt; user.set_password('whatever') &gt;&gt;&gt; user.save() &gt;&gt;&gt; u2 = auth.authenticate(username="jal", password="whatever") &gt;&gt;&gt; print u2 jal </code></pre> <p>This still leaves the mystery as to why it is broken for actually accessing the Django admin GUI, which is why I was headed down this road in the first place. It gives me "Please enter a correct username and password. Note that both fields are case-sensitive" whether or not the password is correct.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload