FastCGI、Lighttpd接口错误/操作错误
我在使用 FastCGI 运行 Django 应用程序时遇到接口错误/操作错误。在检查访问日志(lighttpd 的)时,我发现弹出这些错误,这些错误通常与关闭某些数据库连接或其他连接有关。 浏览器显示以下两件事之一 - 未处理的异常或连接失败消息。 刷新页面一次(通常)后,错误似乎就会消失。 我怎样才能防止这种情况发生? 该系统的行为确实不稳定。
I am getting an Interface Error/ Operational Error while running my Django application with FastCGI.On checking the access log ( of lighttpd) i find these errors pop up which are usually related to closing some db connection or the other.
The browser displays one of the two things - Unhandled Exception or Connection Terminated unsuccessfully message. Upon refreshing the page once ( usually) the errors seem to go off.
How can I prevent this from happening ? The system really behaves in an erratic fashion.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
出现此问题的原因可能有两个。
1. 并非 urls.py 中提到的所有 URL 都能正确反转。
2. 这是最困难的部分 - 项目中的某个地方导入失败。 它可能正在导入一个不存在的方法。
我遇到了同样的问题,我发现有很多像第二点提到的那样的导入。
There could be 2 reasons for this problem occuring.
1. Not all URLs mentioned in your urls.py are reversing properly.
2. This is the tough part - Somewhere in the project an import is failing. It may be importing a method which does not exist.
I faced the same problem and I discovered that there were many imports like the ones mentioned in the second point.
我遇到了同样的问题,在从网上找不到任何内容后编写了自己的解决方案。 请在这里查看我的博文: 用于检查项目中所有导入的简单 Python 实用程序
当然,这只会帮助您快速找到原始问题的解决方案,而不是问题本身的实际解决方案。
I faced the same problem, and wrote my own solution after finding nothing from the web. Please check my blogpost here: Simple Python Utility to check all Imports in your project
Ofcourse this will only help you to get to the solution of the original issue pretty quickly and not the actual solution for your problem by itself.