Reputation: 600
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
Upvotes: 2
Views: 614
Reputation: 600
This is because Django 2.2 is not (as of this writing) compatible with EB.
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html
Django 2.2 is incompatible with the Elastic Beanstalk Python 3.6 platform. The latest compatible version is Django 2.1.
Upvotes: 1