AWSにdjangoをデプロイしました。
開発環境(http://127.0.0.1:8000/admin/)は問題なく表示されるのですが、AWSのElastic Beanstalkにデプロイすると、Internal Server Errorが発生してしまいます。
URLは http://django-env.pk2mp6mrf8.ap-northeast-1.elasticbeanstalk.com/ です。
Pythonのバージョンが開発環境は3.6、AWSのほうは2.7なので、それが問題でしょうか?
他にもsettings.pyのDEBUG = True → DEBUG = Falseを試しましたが、変化はありません。
AWSのログを見ると、以下のようになっています。
[Sat Jun 09 10:37:48.764648 2018] [:error] [pid 27178] [remote 172.31.14.221:128] mod_wsgi (pid=27178): Target WSGI script '/opt/python/current/app/ebdjango/wsgi.py' cannot be loaded as Python module. [Sat Jun 09 10:37:48.764679 2018] [:error] [pid 27178] [remote 172.31.14.221:128] mod_wsgi (pid=27178): Exception occurred processing WSGI script '/opt/python/current/app/ebdjango/wsgi.py'. [Sat Jun 09 10:37:48.764694 2018] [:error] [pid 27178] [remote 172.31.14.221:128] Traceback (most recent call last): [Sat Jun 09 10:37:48.764710 2018] [:error] [pid 27178] [remote 172.31.14.221:128] File "/opt/python/current/app/ebdjango/wsgi.py", line 16, in <module> [Sat Jun 09 10:37:48.764733 2018] [:error] [pid 27178] [remote 172.31.14.221:128] application = get_wsgi_application() [Sat Jun 09 10:37:48.764741 2018] [:error] [pid 27178] [remote 172.31.14.221:128] File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application [Sat Jun 09 10:37:48.764755 2018] [:error] [pid 27178] [remote 172.31.14.221:128] django.setup() [Sat Jun 09 10:37:48.764761 2018] [:error] [pid 27178] [remote 172.31.14.221:128] File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup [Sat Jun 09 10:37:48.764780 2018] [:error] [pid 27178] [remote 172.31.14.221:128] apps.populate(settings.INSTALLED_APPS) [Sat Jun 09 10:37:48.764786 2018] [:error] [pid 27178] [remote 172.31.14.221:128] File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/apps/registry.py", line 78, in populate [Sat Jun 09 10:37:48.764796 2018] [:error] [pid 27178] [remote 172.31.14.221:128] raise RuntimeError("populate() isn't reentrant") [Sat Jun 09 10:37:48.764808 2018] [:error] [pid 27178] [remote 172.31.14.221:128] RuntimeError: populate() isn't reentrant
サーバーのことは理解が乏しいのですが、mod_wsgiに問題があるようなので、そこが問題なのかな?と睨んでいます。
あとはApacheの設定を変えると解決したという情報もあります。
おわかりでしたら教えてください。よろしくお願い致します。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。