前提・実現したいこと
djangoアプリをAWSのEC2にデプロイしたいです。
サーバーはnginxを使っています。
またuWSGIであげようとしています。
また仮想環境はvirtualenvで作っています。
よろしくお願いします。
発生している問題・エラーメッセージ
nginx、wsgiのプロセスは動いているのですが、localhostでもアプリを動かすことができません。
curlを叩くとInternal Server Errorとでてしまいます。
ログ
!!! no internal routing support, rebuild with pcre support !!!
chdir() to /opt/app/apolo_api
your processes number limit is 3896
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: enabled
uWSGI http bound on :5001 fd 3
uwsgi socket 0 bound to UNIX address /tmp/uwsgi.sock fd 6
Python version: 3.5.1 (default, Sep 13 2016, 18:48:37) [GCC 4.8.3 20140911 (Red Hat 4.8.3-9)]
Set PythonHome to /opt/app/venv/
Python main interpreter initialized at 0x225ace0
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 166112 bytes (162 KB) for 2 cores
*** Operational MODE: threaded ***
added /opt/app/apolo_api/api/ to pythonpath.
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 22526)
spawned uWSGI worker 1 (pid: 22527, cores: 2)
*** Stats server enabled on /tmp/uwsgi.stats.sock fd: 12 ***
spawned uWSGI http 1 (pid: 22528)
おそらく
*** no app loaded. going in full dynamic mode ***
の部分で起動しなくなっているのだと思われます。
試したこと
/etc/init/uwsgi_myproject.confファイルの作成
description "uWSGI starter for myproject"
start on (local-filesystems and runlevel [2345])
stop on runlevel [016]
respawn
exec /usr/local/bin/uwsgi /etc/init/myproject.ini
/etc/init/myproject.iniファイルの作成
[uwsgi]
chdir=/opt/app/myproject
module='myproject.wsgi:application'
socket = /tmp/uwsgi.sock
env DJANGO_SETTINGS_MODULE=myproject.settings
master = true
uid = nginx
gid = nginx
http = :5001
venv = /opt/app/venv/
python-path = /opt/app/apolo_api/api/
wsgi = app:app
processes = 1
threads = 2
stats = /tmp/uwsgi.stats.sock
memory-report = true
thunder-lock = true
max-requests = 500
max-requests-delta = 30
touch-reload=/tmp/.uwsgi_reload
よろしくお願いします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/02/10 04:40