djangodjango-modelsdjango-adminsuperuser

Can't login to django admin account after creating super user


I created a project in django and the first thing I want to do is to create a superuser for admin account and then proceed with the django project but the problem is after creating a superuser account using

python manage.py createsuperuser

and filling out the information the superuser gets created it says

Superuser created successfully.

But when I try to login with these credentials it says

Please enter the correct username and password for a staff account. Note that both fields may be case-sensitive.

I am not sure if there is some other setting that I need to check out or I am doing something wrong.

Please suggest me solution for that.


Solution

  • Did you run python manage.py migrate before you ran python manage.py createsuperuser? During createsuperuser process, you need the username and password, you don't need anything else, i.e. email.

    You should do this first, then run python manage.py runserver

    lastly, navigate to http://127.0.0.1:8000/admin/

    There really isn't anything else you would need to do. If you are getting another error, please post it.