Skip to main content

Flask Extension for wechat oauth2.0.

Project description

微信文档: 微信网页授权

安装

pip install Flask-WX-OAuth

使用方式

wx_oauth = WXOAuth()
wx_oauth.init_app(app)

配置 WX_APPID 和 WX_SECRET

在view中调用

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 -p 5000:5000 flask-wx-oauth

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Flask-WX-OAuth-0.1.3.tar.gz (3.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page