henghonglee
henghonglee

Reputation: 1812

Error R11 (Bad bind) -> Process bound to port 8000, should be 25162 (see environment variable PORT)

Hi im trying to deploy my django application on heroku , i am having the error as below, i have already set my PRODUCTION_MODE=true in the code, however it still tries to run at 127.0.0.1:8000, and i am not sure where to set it

2012-03-08T09:46:06+00:00 heroku[web.1]: Starting process with command `python platformsite/manage.py runserver`
2012-03-08T09:46:08+00:00 app[web.1]: Validating models...
2012-03-08T09:46:08+00:00 app[web.1]: 
2012-03-08T09:46:09+00:00 app[web.1]: 0 errors found
2012-03-08T09:46:09+00:00 app[web.1]: Django version 1.4c1, using settings 'platformsite.settings'
2012-03-08T09:46:09+00:00 app[web.1]: Development server is running at http://127.0.0.1:8000/
2012-03-08T09:46:09+00:00 app[web.1]: Quit the server with CONTROL-C.
2012-03-08T09:46:09+00:00 heroku[web.1]: Error R11 (Bad bind) -> Process bound to port 8000, should be 25162 (see environment variable PORT)
2012-03-08T09:46:09+00:00 heroku[web.1]: Stopping process with SIGKILL
2012-03-08T09:46:10+00:00 heroku[web.1]: Process exited with status 137
2012-03-08T09:46:10+00:00 heroku[web.1]: State changed from starting to crashed
2012-03-08T09:46:11+00:00 heroku[router]: Error H10 (App crashed) -> GET pure-fire-3271.herokuapp.com/ dyno= queue= wait= service= status=503 bytes=

how do i set it to the correct port/address values?

Upvotes: 0

Views: 881

Answers (1)

Neil Middleton
Neil Middleton

Reputation: 22240

What do you have in your Procfile? You should ensure that your web process is using $PORT when defining the process:

For instance

web: python my_app/manage.py run_gunicorn -b "0.0.0.0:$PORT"

etc

You shouldn't need to do anything config wise from the default to get a simple Django app working.

More info here: http://devcenter.heroku.com/articles/django

Upvotes: 3

Related Questions