Skip to content

KavinHan/Flask-WX-OAuth

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask-WX-OAuth

微信文档: 微信网页授权

安装

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

About

获取微信用户授权的Flask扩展

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 96.8%
  • Dockerfile 2.2%
  • Makefile 1.0%