Create Django Superuser in GAE Flexible

468 views
Skip to first unread message

Mike Hardy

unread,
Aug 2, 2017, 4:39:45 PM8/2/17
to Google App Engine
Hi There, I've been scouring the internet trying to figure out how to create a Django superuser in GAE Flexible environment, but there aren't many answers, so it leads me to believe that it is very simple and I am just completely lost. Can some kind soul tell me where/how to createsuperuser?

Thanks!
Mike

Kenworth (Google Cloud Platform)

unread,
Aug 2, 2017, 7:05:33 PM8/2/17
to Google App Engine
You can find the details of how to "createsuperuser" here

Mike Hardy

unread,
Aug 3, 2017, 10:49:29 AM8/3/17
to Google App Engine
Thanks for the reply. That's for creating the superuser on your local machine. How do you createsuperuser on the deployed version?

Kenworth (Google Cloud Platform)

unread,
Aug 3, 2017, 11:38:57 PM8/3/17
to Google App Engine
qq: What is your Database? Is it Google Cloud SQL? Can you try "manage.py remote createsuperuser" as per this docs?






Mike Hardy

unread,
Aug 4, 2017, 12:05:34 PM8/4/17
to Google App Engine
Thanks Kenworth. Yes, we're using Cloud SQL. The djangoappengine package hasn't been maintained in multiple years. I don't know that that's something we want to add to our project. Surely there is a simple way to SSH into the GAE instance and run a command or some other method?

Kenworth (Google Cloud Platform)

unread,
Aug 8, 2017, 9:33:48 PM8/8/17
to Google App Engine
1- You can SSH on a GAE Flex instance for debugging purposes by going to your Console > App Engine > Instances > Select SSH on the selected instance.

2- Since the last possible solution offered is not feasible for you, can you detail why would you want to "createsuperuser" on the first place. If your intention is to create a "power user", you can create a root level user on your DB like this StackOverflow thread. If you want a "grant all" permission, this will not work because Cloud SQL does not support "super" privileges as documented here.

3- In addition to #2, provide the versions of your Django, Cloud SQL, and Google Cloud SDK.

Attila-Mihaly Balazs

unread,
Aug 11, 2017, 12:50:03 AM8/11/17
to Google App Engine
One other option is to use the Cloud SQL Proxy [1] to connect from your local machine to the Cloud SQL instance in production and then you could run locally whatever command you need (create super user, etc).

Regards,
Attila

[1] https://cloud.google.com/sql/docs/mysql/connect-admin-proxy

de...@unnotech.com

unread,
Sep 28, 2018, 1:50:57 PM9/28/18
to Google App Engine
This worked for me. We need to do `docker ps` to see the container that has the django container
Reply all
Reply to author
Forward
0 new messages