Django - Dispatch.fcgi在终端中显示正确的输出,但浏览器导致Unhandled Exception

时间:2014-01-16 02:23:13

标签: django fastcgi django-cms flup

我刚刚安装了Django-cms,并在共享主机上使用FastCGI和flup运行Django。 当我打电话给" dispatch.fcgi"从终端,我得到正确的HTML输出。但是,当我尝试从浏览器访问我的网站时,我收到了非特定错误:

  

应用程序抛出了未处理的异常。

以下是终端输出的运行./dispatch.fcgi:

Status: 200 OK
Vary: Accept-Language, Cookie
X-Frame-Options: SAMEORIGIN
Content-Type: text/html; charset=utf-8
Content-Language: en-us

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en">
<head>

等等

我已经尝试在dispatch.fcgi文件中添加if / else语句,将其写入错误日志,但日志为空!

任何人都有任何线索发生错误?如何获得有关&#34;未处理异常的更多信息?&#34;

编辑:下面是dispatch.fcgi:

#!/usr/bin/python

from traceback import format_exc
try:
    # current dispatch.fcgi code

    import sys
    import os

#Make sure to change 'username' to your username!
    sys.path.insert(0, '/home/mcgillme/atlas/atlasproject')

    os.environ['DJANGO_SETTINGS_MODULE'] = 'testatlas.settings'

    import django.core.handlers.wsgi



    from django.core.servers.fastcgi import runfastcgi
    runfastcgi(method="threaded", daemonize="false")

except Exception:
    open("/dispatcherrors.txt", "w").write(format_exc())
    raise

0 个答案:

没有答案