Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在弹性豆茎上使用Django 2.2时出现WSGI错误_Django_Mod Wsgi_Amazon Elastic Beanstalk - Fatal编程技术网

在弹性豆茎上使用Django 2.2时出现WSGI错误

在弹性豆茎上使用Django 2.2时出现WSGI错误,django,mod-wsgi,amazon-elastic-beanstalk,Django,Mod Wsgi,Amazon Elastic Beanstalk,尝试访问部署到AWS Elastic Beanstalk的Django 2.2 web应用程序会出现500错误。检查elastic beanstalk日志时,会显示以下错误 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 pro

尝试访问部署到AWS Elastic Beanstalk的Django 2.2 web应用程序会出现500错误。检查elastic beanstalk日志时,会显示以下错误

 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
mod_wsgi(pid=3388):目标wsgi脚本“/opt/python/current/app/app_name/wsgi.py”不能作为python模块加载。
mod_wsgi(pid=3388):处理wsgi脚本“/opt/python/current/app/app_name/wsgi.py”时发生异常。
回溯(最近一次呼叫最后一次):
文件“/opt/python/current/app/app_name/wsgi.py”,第16行,在
application=get\u wsgi\u application()
文件“/opt/python/run/venv/local/lib/python3.6/site packages/django/core/wsgi.py”,第12行,在get_wsgi_应用程序中
django.setup(set_prefix=False)
文件“/opt/python/run/venv/local/lib/python3.6/site packages/django/_init__.py”,第24行,在安装程序中
应用程序。填充(设置。已安装的应用程序)
文件“/opt/python/run/venv/local/lib/python3.6/site packages/django/apps/registry.py”,第83行,在填充中
raise RUNTIMERROR(“填充()不可重入”)
运行时错误:populate()不可重入

这是因为Django 2.2(在撰写本文时)与EB不兼容

Django 2.2与Elastic Beanstalk Python 3.6不兼容 站台。最新的兼容版本是Django 2.1


你有进一步解释的来源的链接吗?Beanstalk版本的Python3.6有什么特别之处?不确定,我在Amazon上找不到其他解释。我降级到django 2.1,问题解决了。这有变化吗?几个月前,我用Django版本3.0.5部署了一个应用程序,它运行得非常好。我现在创建了一个新的应用程序,对于高于2.1的Django版本,它会给我同样的错误。