Django-nonrel can't login as super user

久未见 提交于 2019-12-08 06:39:49

问题


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?


回答1:


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.



回答2:


From the djangoappengine page:

Important: Don't use dev_appserver.py directly. This won't work as expected because manage.py runserver uses a customized dev_appserver.py configuration




回答3:


aardvax posted great link. But in case no one goes into it. The answer is to create users remotely

creating superuser:

manage.py remote createsuperuser

using remote shell (to use User api):

manage.py remote shell

Hope it helps.



来源:https://stackoverflow.com/questions/4836054/django-nonrel-cant-login-as-super-user

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!