5

我是一个新手,一直在学习 django-nonrel 教程,并在 Google App Engine 中设置了 django-nonrel。

我现在正在尝试使用以下方法创建超级用户:

manage.py createsuperuser --username=joe --email=joe@example.com

我明白了

未知命令:'createsuperuser' 输入
'manage.py help' 以供使用

当我键入 manage.py help 时,我没有看到 createsuperuser 列出。

帮助。

4

3 回答 3

12

解决了这个问题。对于其他有同样问题的人,为了让管理员工作:

1) 确保django.contrib.auth在你的 settings.py 中是 installed_apps 部分

2) 停止 runserver,然后使用manage.py createsuperuser 创建超级用户
创建超级用户后,再次启动 runserver。

于 2010-07-28T17:52:41.653 回答
0

对于仍然无法创建超级用户的用户,您可以从 appengine 管理 Web 界面进行尝试。当您启动应用程序时,您可以看到类似的日志:

prost@prost-VirtualBox:~/projects/website$ ./manage.py runserver
WARNING:root:The rdbms API is not available because the MySQLdb library could not be loaded.
INFO:google.appengine.tools.appengine_rpc:Server: appengine.google.com
INFO:root:Checking for updates to the SDK.
INFO:root:Running application dev~incloudscz on port 8000: http://127.0.0.1:8000
INFO:root:Admin console is available at: http://127.0.0.1:8000/_ah/admin
...
...

管理控制台的最后一行是管理界面的 URL。您可以通过“数据存储查看器”->“实体类型:auth_user”->“列出实体”或“创建实体”来创建/查看用户,并将 is_superuser 设置为 True。

于 2012-06-10T10:20:36.650 回答
0

在幕后,Django 维护了一个“<a href="https://docs.djangoproject.com/en/dev/topics/auth/customizing/#authentication-backends" rel="nofollow">身份验证后端”列表它检查身份验证。因此,您可能会遇到一些其他问题。所以除了@iali的回答。你需要确保你。

  1. make sure that your settings.MIDDLEWARE_CLASSES does not include any additional authentication middleware.
  2. make sure that your settings.AUTHENTICATION_BACKENDS is not set.
于 2014-08-29T17:32:44.790 回答