###heroku上でdjangoプロジェクトをgunicornで走らせたい
djangoプロジェクトをherokuにpushした後、herokuのシェル上で下記コマンドを実行しましたが、gunicornが起動しません。どのような原因が考えられるでしょうか。
###herokuのshell上での実行コマンド
~$ cd djangoProject ~/djangoProject$ gunicorn djangoProject.wsgi
###実行結果
# この内容のまま動かなくなります。 [2016-10-29 15:58:16 +0900] [29] [INFO] Starting gunicorn 19.6.0 [2016-10-29 15:58:16 +0900] [29] [INFO] Listening at: http://0.0.0.0:37152 (29) [2016-10-29 15:58:16 +0900] [29] [INFO] Using worker: sync [2016-10-29 15:58:16 +0900] [32] [INFO] Booting worker with pid: 32 [2016-10-29 15:58:16 +0900] [33] [INFO] Booting worker with pid: 33 [2016-10-29 15:58:16 +0900] [34] [INFO] Booting worker with pid: 34
###プロジェクトフォルダ
. ├── djangoProject │ ├── __pycache__ │ ├── db.sqlite3 │ ├──djangoApp │ │ ├── __init__.py │ │ ├── __pycache__ │ │ ├── admin.py │ │ ├── apps.py │ │ ├── migrations │ │ ├── models.py │ │ ├── templates │ │ ├── tests.py │ │ ├── urls.py │ │ └── views.py │ ├── djangoProject │ │ ├── __init__.py │ │ ├── __pycache__ │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ ├── manage.py │ ├── requirements.txt │ ├── static │ ├── templates │ └── wsgi.py ├── Procfile ├── requirements.txt └── runtime.txt
python
1# djangoProject/djangoProject/wigs.py 2 3import os 4from django.core.wsgi import get_wsgi_application 5 6os.environ.setdefault("DJANGO_SETTINGS_MODULE", "filmdb.settings") 7application = get_wsgi_application()
###補足情報(言語/FW/ツール等のバージョンなど)
Django==1.8.4
Python==3.5.2
###追記(Procfile経由の場合)
Procpile
python
1web: sh -c 'cd filmdb && gunicorn djangoProject.wsgi --log-file -'
ログ
2016-10-30T11:08:39.445506+00:00 heroku[web.1]: Starting process with command `gunicorn djangoProject.wsgi --log-file -` 2016-10-30T11:08:41.304058+00:00 app[web.1]: [2016-10-30 20:08:41 +0900] [3] [INFO] Starting gunicorn 19.6.0 2016-10-30T11:08:41.304544+00:00 app[web.1]: [2016-10-30 20:08:41 +0900] [3] [INFO] Listening at: http://0.0.0.0:48288 (3) 2016-10-30T11:08:41.304654+00:00 app[web.1]: [2016-10-30 20:08:41 +0900] [3] [INFO] Using worker: sync 2016-10-30T11:08:41.307468+00:00 app[web.1]: [2016-10-30 20:08:41 +0900] [7] [INFO] Booting worker with pid: 7 2016-10-30T11:08:41.310039+00:00 app[web.1]: Failed to find application: 'djangoProject.wsgi' 2016-10-30T11:08:41.310148+00:00 app[web.1]: [2016-10-30 20:08:41 +0900] [7] [INFO] Worker exiting (pid: 7) 2016-10-30T11:08:41.338944+00:00 app[web.1]: [2016-10-30 20:08:41 +0900] [3] [INFO] Shutting down: Master 2016-10-30T11:08:41.339047+00:00 app[web.1]: [2016-10-30 20:08:41 +0900] [3] [INFO] Reason: App failed to load. 2016-10-30T11:08:41.409806+00:00 heroku[web.1]: Process exited with status 4 2016-10-30T11:08:41.413963+00:00 heroku[web.1]: State changed from starting to crashed 2016-10-30T11:08:41.414734+00:00 heroku[web.1]: State changed from crashed to starting 2016-10-30T11:08:47.814168+00:00 heroku[web.1]: Starting process with command `gunicorn djangoProject.wsgi --log-file -` 2016-10-30T11:08:50.032231+00:00 app[web.1]: [2016-10-30 20:08:50 +0900] [3] [INFO] Starting gunicorn 19.6.0 2016-10-30T11:08:50.032792+00:00 app[web.1]: [2016-10-30 20:08:50 +0900] [3] [INFO] Listening at: http://0.0.0.0:9480 (3) 2016-10-30T11:08:50.032910+00:00 app[web.1]: [2016-10-30 20:08:50 +0900] [3] [INFO] Using worker: sync 2016-10-30T11:08:50.036835+00:00 app[web.1]: [2016-10-30 20:08:50 +0900] [7] [INFO] Booting worker with pid: 7 2016-10-30T11:08:50.040479+00:00 app[web.1]: Failed to find application: 'djangoProject.wsgi' 2016-10-30T11:08:50.040650+00:00 app[web.1]: [2016-10-30 20:08:50 +0900] [7] [INFO] Worker exiting (pid: 7) 2016-10-30T11:08:50.072522+00:00 app[web.1]: [2016-10-30 20:08:50 +0900] [3] [INFO] Shutting down: Master 2016-10-30T11:08:50.072605+00:00 app[web.1]: [2016-10-30 20:08:50 +0900] [3] [INFO] Reason: App failed to load. 2016-10-30T11:08:50.185799+00:00 heroku[web.1]: State changed from starting to crashed 2016-10-30T11:08:50.164664+00:00 heroku[web.1]: Process exited with status 4
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。