WSGI error using Django 2.2 on Elastic Beanstalk

Viewed 566

Trying to access a Django 2.2 web app deployed to AWS Elastic Beanstalk gives a 500 error. When checking the elastic beanstalk logs the below errors are shown.

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