gunicorn on heroku: binding to localhost

孤者浪人 提交于 2019-12-06 00:29:10

This looks to be the default IP address used when you run use gunicorn to serve a WSGI app with foreman.

Running your django app without foreman like this:

gunicorn hellodjango.wsgi:application

Will bind it to gunicorn's default, 127.0.0.1:8000

2013-08-23 00:02:54 [45352] [INFO] Starting gunicorn 17.5
2013-08-23 00:02:54 [45352] [INFO] Listening at: http://127.0.0.1:8000 (45352)
2013-08-23 00:02:54 [45352] [INFO] Using worker: sync
2013-08-23 00:02:54 [45355] [INFO] Booting worker with pid: 45355

And specifying in your Procfile which binding to use:

web: gunicorn -b 127.0.0.1:8000 hellodjango.wsgi

Will bind it to 127.0.0.1:8000, or whatever you specify.

00:06:26 web.1  | started with pid 45384
00:06:26 web.1  | 2013-08-23 00:06:26 [45384] [INFO] Starting gunicorn 17.5
00:06:26 web.1  | 2013-08-23 00:06:26 [45384] [INFO] Listening at: http://127.0.0.1:8000 (45384)
00:06:26 web.1  | 2013-08-23 00:06:26 [45384] [INFO] Using worker: sync
00:06:26 web.1  | 2013-08-23 00:06:26 [45387] [INFO] Booting worker with pid: 45387

I'd be interested to find exactly where foreman tells gunicorn to use 0.0.0.0 as a default.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!