xiluoduyu 2015-01-08 01:49 采纳率: 100%
浏览 4099
已采纳

uwsgi拒绝一切post请求

这是django1.7 的view代码:
def wx_serve(request):
return HttpResponse('welcome')

这是uwsgi2.0.8响应:
[pid: 3191|app: 0|req: 2/2] **.*.**.** () {36 vars in 687 bytes} [Wed Jan 7 16:11:11 2015] GET /service/toher/ => generated 7 bytes in 1 msecs (HTTP/1.1 200) 2 headers in 88 bytes (1 switches on core 1)
[pid: 3189|app: 0|req: 1/3] **.*.**.** () {42 vars in 686 bytes} [Wed Jan 7 16:11:49 2015] POST /service/toher/ => generated 2650 bytes in 35 msecs (HTTP/1.1 403) 2 headers in 80 bytes (1 switches on core 0)

购买的阿里云服务器,使用nginx1.7.4转发给uwsgi处理,nginx和uwsgi都是常规配置,但为何针对
get请求,服务器响应很正常,却一直拒绝post请求呢?

  • 写回答

4条回答 默认 最新

  • xiluoduyu 2015-01-08 02:48
    关注

    问题暂时解决了! 在setting里面注释掉django.middleware.csrf.CsrfViewMiddleware即可
    谢谢@oyljerry的启发!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?