2012-03-08 37 views
0

嗨即時嘗試部署我的django應用程序在heroku上,我有錯誤如下,我已經設置我PRODUCTION_MODE =真正的代碼,但它仍試圖在127.0.0.1:8000運行,我不知道在哪裏設置錯誤R11(壞綁定) - >過程綁定到端口8000,應該是25162(見環境變量端口)

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= 

我如何將它設置爲正確的端口/地址值?

回答

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

+0

謝謝...我只需要刪除procfile。 – henghonglee 2012-03-09 02:12:16

+0

這個答案幫了我2小時的搜索。謝謝 – 2012-10-04 04:36:52