1

我在 Nginx 上的 Fastcgi 下运行。我有 DEBUG = True,当我在我的网站上访问不正确的 url 时,我得到了正常的 Django 调试页面。

但是,我通过 jQuery 进行了 Ajax 调用,它返回“应用程序引发了未处理的异常”。而不是 Django 回溯。我真的想不通为什么。任何帮助,将不胜感激。

编辑:

def FetchItem(request):
    mimetype = 'application/json'
    item_list = simplejson.loads(request.POST['item_list'])
    auth = functions.auth_session_check(request)
    if auth:
        response = [functions.item_by_id(itemid) for itemid in item_list]
    else:
        response = []
    return HttpResponse(simplejson.dumps(response), mimetype)
4

1 回答 1

2

服务器将返回带有引用和其他信息的常规调试页面。但由于是 ajax 调用,该页面的内容并没有显示在浏览器上。

您可以尝试通过直接访问该 url 来进行非 ajax 调用。

或者在一些开发人员工具(如 goolgle chromes 开发人员工具)中检查 ajax 请求的响应数据。

于 2012-09-14T20:15:42.330 回答