Heroku django app createsuperuser
Asked Answered
E

4

34

I deployed my django app and when I tried

heroku run python manage.py syncdb

I got a timeout awaiting process error. Superuser is not created for the system yet, though i did syncdb by using:

heroku run:detached python manage.py createsuperuser

But this does not prompt me for the superuser.

Port 5000 is not blocked in my system. How do I make heroku run work (or) how do I create the super user?

Expect answered 27/2, 2014 at 22:6 Comment(4)
Check your logs heroku logs , you may have problems with your requirements.txtMonogenesis
Also, the syntax to create a super user is: createsuperuser without spacesMonogenesis
@fasouto: I dont have a problem with the requirements.txt. The app is working and I also did syncdb. Only problem is i cannot create a superuser.Expect
This really looks as though you can't connect, as you seem to be doing the right thing. Can you run heroku logs?Amata
B
90

do not detach the heroku shell:

heroku run python manage.py createsuperuser

worked for me

Bristle answered 6/6, 2015 at 3:12 Comment(1)
Be sure to migrate the DB with heroku run python manage.py migrate, this is only required if the DB was not migrated prior to calling the createsuperuser command.Part
C
7

after wasting entire day i got the answer

heroku run python manage.py syncdb

doesn't run on institute or office lan to run this you must remove system proxy as well

 unset http_proxy
`unset https_proxy`

I hope this will help

Cacia answered 2/2, 2015 at 11:43 Comment(0)
E
2

Try

heroku run python manage.py shell

And then create your superuser from there. Good luck!

Expertize answered 28/2, 2014 at 6:4 Comment(2)
Try heroku run bash and then do a python manage.py shell.Expertize
anything with heroku run gives a timeoutExpect
P
1

More info please.
What DB are you using?
Have you set your local_settings.py?
Are you using Debian?

I use Postgres on Debian so I had to both apt-get install python-psycopg2 (otherwise you can't use postgres) and pip install --user psycopg2 (otherwise pip freeze misses Postgres), then manually create a user and db. Replace USER with the username from your local_settings.py

sudo su - postgres
createuser USER -dPRs
createdb --owner USER  db.db
Programmer answered 17/3, 2014 at 22:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.