在AWS Beanstalk上部署Django遇到Erorr 500 WSGI错误

花了几个小时。 尝试在AWS Elastic Beanstalk上部署Django APP,但由于出现错误。

日志:

[Mon Nov 04 20:29:56.672898 2019] [:error] [pid 5877] [remote 172.31.27.176:8]     raise RuntimeError("populate() isn't reentrant")
[Mon Nov 04 20:29:56.672912 2019] [:error] [pid 5877] [remote 172.31.27.176:8] RuntimeError: populate() isn't reentrant
[Mon Nov 04 20:29:57.139970 2019] [:error] [pid 5877] [remote 172.31.27.176:8] mod_wsgi (pid=5877): Target WSGI script '/opt/python/current/app/vendease/wsgi.py' cannot be loaded as Python module.
[Mon Nov 04 20:29:57.140026 2019] [:error] [pid 5877] [remote 172.31.27.176:8] mod_wsgi (pid=5877): Exception occurred processing WSGI script '/opt/python/current/app/vendease/wsgi.py'.
[Mon Nov 04 20:29:57.140136 2019] [:error] [pid 5877] [remote 172.31.27.176:8] Traceback (most recent call last):
[Mon Nov 04 20:29:57.140169 2019] [:error] [pid 5877] [remote 172.31.27.176:8]   File "/opt/python/current/app/vendease/wsgi.py",line 16,in <module>
[Mon Nov 04 20:29:57.140174 2019] [:error] [pid 5877] [remote 172.31.27.176:8]     application = get_wsgi_application()
[Mon Nov 04 20:29:57.140180 2019] [:error] [pid 5877] [remote 172.31.27.176:8]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/core/wsgi.py",line 12,in get_wsgi_application
[Mon Nov 04 20:29:57.140184 2019] [:error] [pid 5877] [remote 172.31.27.176:8]     django.setup(set_prefix=False)
[Mon Nov 04 20:29:57.140189 2019] [:error] [pid 5877] [remote 172.31.27.176:8]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/__init__.py",line 24,in setup
[Mon Nov 04 20:29:57.140193 2019] [:error] [pid 5877] [remote 172.31.27.176:8]     apps.populate(settings.INSTALLED_APPS)
[Mon Nov 04 20:29:57.140198 2019] [:error] [pid 5877] [remote 172.31.27.176:8]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/apps/registry.py",line 83,in populate
[Mon Nov 04 20:29:57.140202 2019] [:error] [pid 5877] [remote 172.31.27.176:8]     raise RuntimeError("populate() isn't reentrant")
[Mon Nov 04 20:29:57.140216 2019] [:error] [pid 5877] [remote 172.31.27.176:8] RuntimeError: populate() isn't reentrant

我的django.config看起来像:

option_settings:
  aws:elasticbeanstalk:container:python:
    WSGIPath: vendease/wsgi.py
apple9871 回答:在AWS Beanstalk上部署Django遇到Erorr 500 WSGI错误

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3164143.html

大家都在问