官方文档
安装
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
Metadata
Release files for Flask-WX-OAuth 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| Flask-WX-OAuth-0.2.3.tar.gz | 4.0 kB | Details |
Release files / Flask-WX-OAuth-0.2.3.tar.gz
| Download URL | Flask-WX-OAuth-0.2.3.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
130b2bf4b95b9e9bc4699cd55915549df40ce932fc357c5d77069fb8510806c3
|
|
BLAKE2b-256 checksum How to use checksums |
3620f3459c1da19ee8c0eab6e0c7253964b0f45d0ccbe2c2d5fd27e639a294cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|