我在使用 FastCGI 运行我的 Django 应用程序时遇到接口错误/操作错误。在检查访问日志(lighttpd)时,我发现这些错误弹出,这些错误通常与关闭某些数据库连接或其他有关。浏览器显示两件事之一 - 未处理的异常或连接终止失败消息。刷新页面一次(通常)后,错误似乎消失了。我怎样才能防止这种情况发生?该系统确实以一种不稳定的方式运行。
问问题
299 次
2 回答
1
出现此问题可能有 2 个原因。1. 并非 urls.py 中提到的所有 URL 都正确反转。2. 这是困难的部分 - 在项目中的某个地方导入失败。它可能正在导入一个不存在的方法。
我遇到了同样的问题,我发现有很多像第二点提到的那样的进口。
于 2009-02-05T18:04:42.570 回答
0
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.
于 2009-11-16T18:43:47.303 回答