33

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?

agconti
  • 17,780
  • 15
  • 80
  • 114
Aswin Murugesh
  • 10,831
  • 10
  • 40
  • 69
  • 1
    Check your logs `heroku logs` , you may have problems with your requirements.txt – fasouto Feb 27 '14 at 22:37
  • 2
    Also, the syntax to create a super user is: `createsuperuser` without spaces – fasouto Feb 27 '14 at 22:38
  • 1
    @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. – Aswin Murugesh Feb 28 '14 at 04:06
  • 1
    This really looks as though you can't connect, as you seem to be doing the right thing. Can you run `heroku logs`? – Rob Grant Sep 09 '14 at 23:37

4 Answers4

87

do not detach the heroku shell:

heroku run python manage.py createsuperuser

worked for me

Fra
  • 4,918
  • 7
  • 33
  • 50
  • 9
    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. – Erion S Jan 05 '16 at 09:59
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

hello123
  • 391
  • 4
  • 15
2

Try

heroku run python manage.py shell

And then create your superuser from there. Good luck!

Erik
  • 7,479
  • 8
  • 62
  • 99
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