Skip to main content

Flask Extension for wechat oauth2.0.

Project description

安装

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')

在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 -v $(pwd):/app -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.

Files for Flask-WX-OAuth, version 0.2.3
Filename, size File type Python version Upload date Hashes
Filename, size Flask-WX-OAuth-0.2.3.tar.gz (4.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page