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.

Source Distribution

Flask-WX-OAuth-0.2.3.tar.gz (4.0 kB view details)

Uploaded Source

File details

Details for the file Flask-WX-OAuth-0.2.3.tar.gz.

File metadata

  • Download URL: Flask-WX-OAuth-0.2.3.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

File hashes

Hashes for Flask-WX-OAuth-0.2.3.tar.gz
Algorithm Hash digest
SHA256 130b2bf4b95b9e9bc4699cd55915549df40ce932fc357c5d77069fb8510806c3
MD5 648882f680e45e75283648b5d6e31394
BLAKE2b-256 3620f3459c1da19ee8c0eab6e0c7253964b0f45d0ccbe2c2d5fd27e639a294cf

See more details on using hashes here.

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