I'm facing an error while trying to deploy my django app through Elastic Beanstalk service. Locally everything works correctly.
I also try to modify my code based on answers Django stops working with RuntimeError: populate() isn't reentrant and this Target WSGI script '/opt/python/current/app/ … /wsgi.py' cannot be loaded as Python module without success.
[: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
Moreover my wsgi.py file :
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "diamond.settings")
application = get_wsgi_application()
and my django.config
included into
option_settings:
aws:elasticbeanstalk:container:python:
WSGIPath: diamond/wsgi.py
Thanks in advance