我有一个使用FCGI在共享服务器上运行的Django应用程序。当我从命令行运行dispatch.fcgi脚本时,我按预期看到了我主页的HTML内容。但是,当我尝试使用浏览器访问我的主页时,出现500错误。我的问题基本上与这个问题相同:Django FastCGI and 500 Internal Server Error,除了我已经使用Python 2.6版。
答案 0 :(得分:0)
您需要记录异常 - 将整个dispatch.fcgi文件放在try / except块中,并将回溯写入您可以检查的文件:
from traceback import format_exc
try:
# current dispatch.fcgi code
except Exception:
open("/path/you/can/write/to.txt", "w").write(format_exc())
raise
希望这足以弄清楚潜在的问题。