【发布时间】:2020-02-10 21:53:24
【问题描述】:
尝试访问部署到 AWS Elastic Beanstalk 的 Django 2.2 Web 应用程序会出现 500 错误。检查弹性豆茎日志时,会显示以下错误。
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
【问题讨论】:
标签: django mod-wsgi amazon-elastic-beanstalk