我在Django中有一个返回错误500的视图,我无法弄清楚原因。看起来像这样:
def some_view(request):
result = some_func(request.raw_post_data)
response = HttpResponse(status=200)
response['Content-Type'] = 'application/json'
response.content = simplejson.dumps(result)
# if I log something here, it will be printed, so control reaches here
return response
所以看起来我的视图工作正常,然后在Django内部发生了一些事情,但我无法追踪到底发生了什么。有什么暗示它是什么或如何找到它?
可能很重要的事情:
答案 0 :(得分:0)
问题在于Apache中的FastCGI模块有30秒超时,Django准备响应需要30多秒。然后,Apache返回了通用500错误消息。