【发布时间】:2013-08-24 20:31:26
【问题描述】:
我一直在关注https://devcenter.heroku.com/articles/django#declare-process-types-with-procfile 上的教程。 除了一件让我烦恼的事情之外,一切都很顺利。
在启动工头后,我应该看到以下内容:
$ foreman start
2013-04-03 16:11:22 [8469] [INFO] Starting gunicorn 0.17.2
2013-04-03 16:11:22 [8469] [INFO] Listening at: http://127.0.0.1:8000 (8469)
但是,我得到:
Starting gunicorn 17.5
Listening at: http://0.0.0.0:5000
如何更改它以使其仅侦听我的本地计算机(即 127.0.0.1)?
我的 Procfile 只包含
web: gunicorn hellodjango.wsgi
谢谢!
【问题讨论】:
-
您确定您在本地使用工头吗?
http://0.0.0.0:5000是 heroku 在将项目推送给他们时提供的标准公共 URL。 -
在教程的那个阶段没有推送到heroku(甚至没有git repo)。 gunicorn 的默认绑定是 127.0.0.1:8000 还是 0.0.0.0:5000?
-
我相信本地是 127 并且在 heroku 0.0.0 上。
-
所以在我的情况下它没有正确配置,因为它似乎没有这样做(请参阅我的后续问题)。
标签: django heroku gunicorn procfile