Weapp auth is a Django app that helps to handle wechat mini program login and user info updating logic.
-
Install using pip
pip install --upgrade django-weapp-auth
-
Add "weapp_auth" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = [ ... 'weapp_auth', ]
-
Include the weapp_auth URLconf in your project urls.py like this::
path('weapp_auth/', include('weapp_auth.urls')),
-
Run
python manage.py migrate
to create the models. -
These two APIs are avaliable!
weapp_auth/wechatLogin/
andweapp_auth/wechatUpdateUserInfo/
-
Call these two APIs in your wechat mini app!
-
Authenticate your request with
from weapp_auth.authenticator.OpenIdAuthenticator import OpenIdAuthenticator