I was working through the polls tutorial and everything was fine until I tried to log in to the admin site; it just said
"Please enter the correct username and password for a staff account. Note that both fields may be case-sensitive."
So I Googled the issue and tried everything I could. Here are all the problems I investigated:
- Database not synced: I synced it and nothing changed.
- No
django_sessiontable: I checked; it's there. - Problematic settings: The only change I made to the settings was the addition of
'polls.apps.PollsConfig',toINSTALLED_APPS. - User not configured correctly:
is_staff,is_superuser, andis_activeare allTrue. - Old sessions: I checked the
django_sessiontable and it's empty. - Oversized message cookie: I checked and I don't even have one.
- Created superuser while running web server: I did this, but after stopping the web server, creating a new user, and restarting the web server, and trying to log in with the new user, it still didn't work.
- Missing or wrong URL pattern: Currently I have
url(r"^admin/", admin.site.urls)in mysite/urls.py. - Entering wrong username: The username I created was "admin" and that's the same one I'm typing in.
- Wrong server command: I'm using
python manage.py runserver. - Something wrong with database: I tried deleting the database and then reapplying the migrations, but nothing changed.
Is there anything I haven't tried yet, or am I missing something?
python manage.py createsuperuser