django做后台,微信公众平台始终提示你的服务器没有响应正确的token,请问该如何查找解决该问题?


后台:nginx+uwsgi+django

微信公众平台是ajax请求的吗?django该如何处理?

微信GET请求时uwsgi打印的信息:

[pid: 1797|app: 0|req: 4/4] 101.226.64.201 () {34 vars in 634 bytes} [Tue Nov 12 03:10:18 2013] GET /weixin?signature=2afa22a48e947f569fe3fd73947f822d09c3f7a1&echostr=5945719633796526203&timestamp=1384247416&nonce=1384345734 => generated 0 bytes in 0 msecs (HTTP/1.0 301) 2 headers in 231 bytes (1 switches on core 0)

views.py:


 def weixin(request):
    echostr = request.GET.get('echostr', '')
    return HttpResponse(echostr)

自己用浏览器输入 http://42.96.xx.xx//weixin?signature=2afa22a48e947f569fe3fd73947f822d09c3f7a1&echostr=5945719633796526203&timestamp=1384247416&nonce=1384345734 可以得到echostr

python django 微信 微信公众平台

蓝色&幽灵 10 years, 11 months ago

Your Answer