gpt4 book ai didi

google-app-engine - Django-nonrel 无法以 super 用户身份登录本地主机管理站点

转载 作者:太空宇宙 更新时间:2023-11-03 15:30:05 24 4
gpt4 key购买 nike

我很好地设置了 django-nonrel,并顺利完成了 djangobook 的前 5 章,没有任何实际问题。我目前在讨论创建管理站点的第 6 章。 http://www.djangobook.com/en/2.0/chapter06/但是,我无法登录。

我可以在本地主机上进入管理员登录页面,但它总是说我的用户名和密码不正确。

有人建议“进入您的数据库并检查 auth_user 表。确保您用于登录的用户的 is_staff 设置为 TRUE。”我进入这里:“python manage.py shell”,看到我的 super 用户在那里,那是 is_staff 是真的。

我在服务器运行和不运行的情况下创建了一个 super 用户,之后没有人允许我登录。

一位用户 (crogjer) 建议如下:

This might be the problem:

You have setup a database for a normal django project. So manage.py createsuperuser will create a superuser in that database.

In case of GAE SKD, it uses the GAE Datastore, so the superuser you created is not present >there.

This is what you could do:

Create a normal user Go to /_ah/admin/ and modify the data for user table in datastore, changing the desired >users is_superuser field to True.

什么是 SKD?这听起来像是我的问题的答案吗?如果是这样,我该如何创建普通用户?

以下是我看到的一些引用帖子:我查看了以下帖子: Can't login to Django /admin interface django-nonrel google app engine fail to log in admin panel Django-nonrel can't login as super user

知道我可能做错了什么吗?谢谢!

最佳答案

我明白了。当它不工作时,我通过 GoogleAppEngineLauncher 运行服务器,我只需要停止本地服务器,创建 super 用户,然后通过

 python manage.py runserver

关于google-app-engine - Django-nonrel 无法以 super 用户身份登录本地主机管理站点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7680859/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com