django - 使用 Django 的 Elelastic Beanstalk 上的 WSGI 问题
问题描述
几天前,我在 AWS elastic beanstalk(EB) 上部署了一个 Django,它运行良好。今天,在新部署之后,我对 view.py 做了一些小改动,EB 上的 Django APP 出现了一个非常大的问题,它变得无法访问了。查看 AWS EB 中的日志文件,我读到了以下错误:
Script timed out before returning headers: wsgi.py
End of script output before headers: wsgi.py, referer ...
您对如何解决此问题有任何想法吗?
我要提前谢谢你,
解决方案
两种可能的解决方案(取决于您的具体情况)
这是解决此特定问题 End of script output before headers 的类似问题:wsgi.py deploying python django to AWS EB
将此 WSGIApplicationGroup %{GLOBAL} 添加到您的 wsgi 配置中。它指导您的 wsgi 应用程序 - 您的 django 应用程序“在 Python 初始化时创建的第一个 Python 子解释器中运行”(来自https://modwsgi.readthedocs.io/en/develop/user-guides/application-issues。 html#python-simplified-gil-state-api )
另一种解决方案与增加您正在使用的实例的内存有关。
推荐阅读
- r - AppVeyor 无法删除之前安装的软件包
- javascript - JavaScript 正则表达 dotall 和全局标志
- python - 使用“Gooey”在 GUI 和 CLI 模式之间切换的“聪明”方式
- android - 将项目更新到 Android X 后编译时出错
- python-3.x - 如何从 Python 中的字符串中提取占位符子字符串?
- python - 从 django-rest 检索数据以显示在表单中
- python-3.x - python中数学运算中的字符串
- reactjs - 如何修复:TypeError:projects.map 不是函数
- mysql - Mysql/Laravel : Using left join to fetch latest created at date of any employee
- parallel-processing - 在 Julia 中使用 @distributed 时可能的 reducer 函数列表