![](/img/trans.png)
[英]Django channels Error during WebSocket handshake: Unexpected response code: 500
[英]Unexpected error 500 when returning response in Django, what's going on?
我在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内部发生了某些事情,但是我无法跟踪它确切发生的位置。 关于它是什么或如何找到的任何提示?
可能重要的事情:
问题是Apache中的FastCGI模块有30秒的超时,而Django准备响应花费了30多秒。 然后,Apache返回通用500错误消息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.