pip install Flask-WX-OAuth
flask扩展的使用方式:
from flask_wx_oauth import WXOAuth
wx_oauth = WXOAuth()
wx_oauth.init_app(app)
也可以每次初始化后使用:
from flask_wx_oauth import WXOAuth
wx_oauth = WXOAuth(appid='YOUR APPID', secret='YOUR SECRET')
next = request.args.get('next', '/')
redirect_uri = url_for('.authorized', next=next, _external=True)
params = dict(
redirect_uri=redirect_uri,
scope='snsapi_base',
)
return redirect(wx_oauth.get_authorize_url(**params))
docker build -t flask-wx-oauth .
docker run -v $(pwd):/app -p 5000:5000 flask-wx-oauth