/ / gunicorn on heroku:localhostへのバインディング - django、heroku、gunicorn、procfile

gunroornのheroku:localhostへのバインディング - django、heroku、gunicorn、procfile

私は「チュートリアルを続けてきました」 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

ありがとう!

回答:

回答№1は5

これは、use gunicornを実行してフォアマンでWSGIアプリを提供するときに使用されるデフォルトのIPアドレスのように見えます。

このような職長なしであなたのdjangoアプリを実行します。

gunicorn hellodjango.wsgi:application

gunicornのデフォルトにバインドします 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

そしてあなたに指定する Procfile 使用するバインディング

web: gunicorn -b 127.0.0.1:8000 hellodjango.wsgi

にバインドします 127.0.0.1:8000またはあなたが指定するものは何でも。

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

職長がgunicornに使用するように指示する場所を正確に見つけることに興味があります 0.0.0.0 デフォルトとして。