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

时间:2018-09-11 16:27:27   收藏:0   阅读:430

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;
        }

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!