码迷,mamicode.com
首页 > 微信 > 详细

微信公众号绑定服务器 python版

时间:2018-09-11 16:27:27      阅读:430      评论:0      收藏:0      [点我收藏+]

标签:code   request   span   als   ==   return   name   服务   cors   

python 代码

from flask import Flask, request
from flask_cors import CORS

app = Flask(__name__)
app.app_context().push()


@app.route(/weixin)
def weixin():
    return request.args.get(echostr)


def runFlask(port):
    app.run(host=0.0.0.0,port=port)
    CORS(app, supports_credentials=True)


if __main__ == __name__:
    runFlask(666)

 

nginx转发

        location /weixin {
            proxy_pass   http://127.0.0.1:666/weixin;
        }

 

微信公众号绑定服务器 python版

标签:code   request   span   als   ==   return   name   服务   cors   

原文地址:https://www.cnblogs.com/lurenjia1994/p/9627802.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!