Django-nonrel无法以超级用户身份登录 [英] Django-nonrel can't login as super user

查看:80
本文介绍了Django-nonrel无法以超级用户身份登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经做了这样的命令

python manage.py createsuperuser

如果我python manage.py runserver

在这种情况下,我可以登录,并且可以看到我创建的用户.

In this case I can login, and I can see the user I created.

如果我使用GAE的SDK启动服务器,则无法登录.为什么?

While if I use GAE's SDK to start the server, I canNOT log in. Why?

推荐答案

这可能是问题所在

您已经为正常的django项目设置了数据库.
因此manage.py createsuperuser将在该数据库中创建一个超级用户.

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

对于GAE SKD,它使用GAE Datastore,因此您创建的超级用户不存在.

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

这是您可以做的:

  • 创建普通用户
  • 转到/_ah/admin/并修改数据存储区中用户表的数据,将所需的用户is_superuser字段更改为True.
  • 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.

这篇关于Django-nonrel无法以超级用户身份登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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