【发布时间】:2013-08-28 07:38:33
【问题描述】:
这是来自gunicorn on heroku: binding to localhost 的衍生问题。
如何让 gunicorn 在本地(使用工头)和 Heroku 上部署工作?
Procfile 包含:
web: gunicorn mysite.wsgi
当我使用工头在本地部署时,gunicorn 绑定到 http://0.0.0.0:5000。我希望它绑定到127.0.0.1:8000。但是,如果我将 Procfile 更改为:
web: gunicorn -b 127.0.0.1:8000 mysite.wsgi
然后我无法部署到Heroku,浏览器会返回“应用程序错误”
$ heroku ps
=== web (1X): `gunicorn -b 127.0.0.1:8000 mysite.wsgi`
web.1: crashed 2013/08/22 23:45:04 (~ 1m ago)
默认绑定地址设置在哪里和/或我在 Procfile 中放置了哪些 gunicorn 选项以使其在 127.0.0.1 上工作? 我的情况可能有什么独特之处导致默认设置异常(我在 Mac OS 中工作 - 也许是狮子?)
【问题讨论】:
标签: django heroku gunicorn procfile