1

I am trying to run my first Django powered app on Heroku. I have been following this guide. The app is running fine using:

python manage.py runserver

When I commit any changes I made, and then try to push it to Heroku, everything seems fine until I visit the heroku URL. I receive an 'Application Error' page. Looking more in to the:

heroku logs

I get a bunch of what appears to be the same error message:

.......
2013-01-18T05:28:29+00:00 heroku[slugc]: Slug compilation finished
2013-01-18T05:28:29+00:00 app[web.1]: Error: "0.0.0.0:" is not a valid port number        or address:port pair.
2013-01-18T05:28:31+00:00 heroku[web.1]: Process exited with status 1
2013-01-18T05:28:32+00:00 heroku[web.1]: Starting process with command `python      manage.py runserver 0.0.0.0: --noreload`
2013-01-18T05:28:33+00:00 app[web.1]: Error: "0.0.0.0:" is not a valid port number or     address:port pair.

Also if I do a foreman start:

22:39:26 web.1  | started with pid 2499
22:39:26 web.1  | Error: "0.0.0.0:" is not a valid port number or address:port pair.
22:39:26 web.1  | exited with code 1
22:39:26 system | sending SIGTERM to all processes
SIGTERM received

I looked at a similar question but I seem to have everything needed in my requirements.txt file.

Thanks for the help!

2 Answers 2

2

It looks like you have something strange in your Procfile. Examine your Procfile and either follow the Heroku instructions for setting up gunicorn (recommended for production), or else add a port number -- presumably 80 -- to your Procfile as so:

python manage.py runserver 0.0.0.0:80 --noreload

1
  • Thanks - I ended up solving this, I had the port number wrong. I ended up using gunicorn anyway.
    – Joker
    Jan 19, 2013 at 6:29
2

Using Heroku and Docker I got the same error but I was using the $PORT environment variable.

For some reason the port number had a backslash (\) as in \80. So I had to remove it:

python manage.py runserver 0.0.0.0:${PORT##\\}

For future reference, in case someone stumbles upon this question as I did in hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.