Django-nonrel不能以超级用户身份登录 [英] Django-nonrel can't login as super user
问题描述
我已经完成了这样的命令
python manage.py createduperuser
/ pre>
如果我做
python manage.py runserver
在这种情况下,我可以登录,我可以看到我创建的用户。
虽然如果我使用GAE的SDK启动服务器,我无法登录。为什么?
解决方案这可能是问题:
为普通django项目设置数据库。
所以manage.py createduperuser
将在该数据库中创建超级用户。
如果是GAE SKD,它使用
GAE Datastore
,因此您创建的超级用户不在那里。
这是你可以做的:
- 创建普通用户
- 转到
/ _ ah / admin /
并修改数据存储区中用户表的数据,将所需用户的is_superuser字段更改为True
。
I"ve done such commands
python manage.py createsuperuser
If I do python manage.py runserver
In this case I can login, and I can see the user I created.
While if I use GAE's SDK to start the server, I canNOT log in. Why?
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 toTrue
.
这篇关于Django-nonrel不能以超级用户身份登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!