Django не может развернуться из-за ошибки mod_wsgi [AWS] - PullRequest
0 голосов
/ 25 апреля 2018

Я сталкиваюсь с ошибкой при попытке развернуть приложение django через сервис Elastic Beanstalk.Локально все работает правильно.

Я также пытаюсь изменить свой код на основе ответов Django перестает работать с RuntimeError: populate () не реентерабелен и этот целевой сценарий WSGI '/opt / python / current / app /… /wsgi.py 'не может быть загружен как модуль Python без успеха.

 [:error] [pid 3519] mod_wsgi (pid=3519): Target WSGI script '/opt/python/current/app/diamond/wsgi.py' cannot be loaded as Python module.
 [:error] [pid 3519] mod_wsgi (pid=3519): Exception occurred processing WSGI script '/opt/python/current/app/diamond/wsgi.py'.
 [:error] [pid 3519] Traceback (most recent call last):
 [:error] [pid 3519]   File "/opt/python/current/app/diamond/wsgi.py", line 16, in <module>
 [:error] [pid 3519]     application = get_wsgi_application()
 [:error] [pid 3519]   File "/opt/python/run/venv/local/lib/python3.4/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
 [:error] [pid 3519]     django.setup(set_prefix=False)
 [:error] [pid 3519]   File "/opt/python/run/venv/local/lib/python3.4/site-packages/django/__init__.py", line 24, in setup
 [:error] [pid 3519]    apps.populate(settings.INSTALLED_APPS)
 [:error] [pid 3519]   File "/opt/python/run/venv/local/lib/python3.4/site-packages/django/apps/registry.py", line 81, in populate
 [:error] [pid 3519]     raise RuntimeError("populate() isn't reentrant")
 [:error] [pid 3519] RuntimeError: populate() isn't reentrant

Кроме того, мой файл wsgi.py:

import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "diamond.settings")

application = get_wsgi_application()

а мой django.config включен в

option_settings:
  aws:elasticbeanstalk:container:python:
    WSGIPath: diamond/wsgi.py

Заранее спасибо

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...