Creating superuser in django-nonrel
Asked Answered
E

3

5

I'm a newbie been going through the django-nonrel tutorials and have set up django-nonrel inside of Google App Engine.

I am now trying to create a superuser using:

manage.py createsuperuser --username=joe [email protected]

I get

Unknown command: 'createsuperuser'
Type 'manage.py help' for usage

When I type manage.py help, I don't see createsuperuser listed.

Help.

Earthwork answered 28/7, 2010 at 12:33 Comment(0)
E
12

Solved this. For anyone else having the same problem, in order to get admin to work:

1) Ensure that django.contrib.auth is installed_apps section in your settings.py

2) Stop runserver, then createsuperuser using manage.py createsuperuser.
AFTER you've created the superuser, start runserver again.

Earthwork answered 28/7, 2010 at 17:52 Comment(3)
Nice, forgot to stop the server. Guess more people forget that easilyHorrified
Doesn't work for me. I'm on GoogleAppEngine 1.6.2 with python 2.7.2.Heinrick
If this is a new django install, then don't forget to run python manage.py syncdb first.Searles
C
0

For those who are still not able to create superuser, you can try it from appengine admin web interface. When you start your application you can see similar log:

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
...
...

The last line with admin console is URL of an admin interface. You can create/view user there via "Datastore viewer" -> "Entity kind: auth_user" -> "List entities" or "Create entity" with is_superuser set to True.

Chink answered 10/6, 2012 at 10:20 Comment(0)
M
0

Behind the scenes, Django maintains a list of “authentication backends” that it checks for authentication. As a result of this there could be a few additional problems you can run into. So in addition to @iali's answer. You need to make sure that you.

  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.
Meekins answered 29/8, 2014 at 17:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.