错误R11(错误绑定) - >绑定到端口8000的进程应该是25162(参见环境变量PORT)

时间:2012-03-08 09:53:03

标签: python django heroku

您好我试图在heroku上部署我的django应用程序, 我有如下错误,我已经在代码中设置了我的PRODUCTION_MODE = true,但它仍然尝试在127.0.0.1:8000运行,我不知道在哪里设置它

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=

如何将其设置为正确的端口/地址值?

1 个答案:

答案 0 :(得分:3)

你的Procfile有什么?在定义流程时,应确保Web流程使用$ PORT:

例如

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

您不需要在默认情况下进行任何配置操作以获得简单的Django应用程序。

此处有更多信息:http://devcenter.heroku.com/articles/django