アプリサーバーとしてuwsgiを使用してDjangoをHeroku(杉のスタック)にデプロイしようとしています。
専用サーバーへの展開で正常に使用したいくつかの構成を試しました。ただし、Procfileで$ PORT env変数を使用しているにもかかわらず、Herokuはuwsgiが正しいポートでリッスンしていないと不平を言い続けます。
Procfile
web: uwsgi --http :$PORT --home $HOME --ini conf/uwsgi.ini
conf / uwsgi.ini
(私はたくさんの構成の微調整を試したことに注意してください。これは私が試した中で最も単純なものであり、間違ったポート番号については常に同じエラーです。)
env = DJANGO_SETTINGS_MODULE=retargeting.settings
module = django.core.handlers.wsgi:WSGIHandler()
これが私のherokuログからの出力です:
2012-03-30T17:36:09+00:00 heroku[slugc]: Slug compilation finished2012-03-30T17:36:13+00:00 heroku[web.1]: Starting process with command `uwsgi --http :3810 --home /app --ini conf/uwsgi.ini`
2012-03-30T17:36:13+00:00 app[web.1]: [uWSGI] getting INI configuration from conf/uwsgi.ini
2012-03-30T17:36:13+00:00 app[web.1]: *** Starting uWSGI 1.1.2 (64bit) on [Fri Mar 30 17:36:13 2012] ***
2012-03-30T17:36:13+00:00 app[web.1]: compiled with version: 4.4.3 on 30 March 2012 03:51:49
2012-03-30T17:36:13+00:00 app[web.1]: current working directory: /app
2012-03-30T17:36:13+00:00 app[web.1]: detected binary path: /app/bin/uwsgi
2012-03-30T17:36:13+00:00 app[web.1]: *** WARNING: you are running uWSGI without its master process manager ***
2012-03-30T17:36:13+00:00 app[web.1]: your memory page size is 4096 bytes
2012-03-30T17:36:13+00:00 app[web.1]: detected max file descriptor number: 10000
2012-03-30T17:36:13+00:00 app[web.1]: lock engine: pthread mutexes
2012-03-30T17:36:13+00:00 app[web.1]: uWSGI http bound on :3810 fd 4
2012-03-30T17:36:13+00:00 app[web.1]: spawned uWSGI http 1 (pid: 4)
2012-03-30T17:36:13+00:00 app[web.1]: uwsgi socket 0 bound to TCP address 127.0.0.1:43681 (port auto-assigned) fd 3
2012-03-30T17:36:13+00:00 app[web.1]: Python version: 2.7.2 (default, Oct 31 2011, 16:22:04) [GCC 4.4.3]
2012-03-30T17:36:13+00:00 app[web.1]: Set PythonHome to /app
2012-03-30T17:36:13+00:00 app[web.1]: Python main interpreter initialized at 0x134c5d0
2012-03-30T17:36:13+00:00 app[web.1]: your server socket listen backlog is limited to 100 connections
2012-03-30T17:36:13+00:00 app[web.1]: *** Operational MODE: single process ***
2012-03-30T17:36:13+00:00 app[web.1]: WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x134c5d0 pid: 3 (default app)
2012-03-30T17:36:13+00:00 app[web.1]: *** uWSGI is running in multiple interpreter mode ***
2012-03-30T17:36:13+00:00 app[web.1]: spawned uWSGI worker 1 (and the only) (pid: 3, cores: 1)
2012-03-30T17:36:14+00:00 heroku[web.1]: Error R11 (Bad bind) -> Process bound to port 43681, should be 3810 (see environment variable PORT)
2012-03-30T17:36:14+00:00 heroku[web.1]: Stopping process with SIGKILL
2012-03-30T17:36:15+00:00 heroku[web.1]: Process exited with status 137
2012-03-30T17:36:15+00:00 heroku[web.1]: State changed from starting to crashed
ログの最初の行からわかるように、正しいポートがuwsigiに渡されています。これが機能しない理由について何か考えはありますか?