创建超级用户后无法登录django管理员帐户 [英] Can't login to django admin account after creating super user

查看:89
本文介绍了创建超级用户后无法登录django管理员帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在django中创建了一个项目,我要做的第一件事是为管理员帐户创建一个超级用户,然后继续进行django项目,但问题是在使用创建了一个超级用户帐户之后

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

python manage.py createsuperuser

并填写超级用户创建的信息

and filling out the information the superuser gets created it says

超级用户创建成功.

但是当我尝试使用这些凭据登录时,它说

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.

请为我建议解决方案.

推荐答案

在运行 python manage.py createsuperuser 之前,您是否运行过 python manage.py migration ?在 createsuperuser 过程中,您需要用户名和密码,不需要其他任何内容,即电子邮件.

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.

您应该先执行此操作,然后再运行 python manage.py runserver

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

最后,导航至 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.

这篇关于创建超级用户后无法登录django管理员帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆