JSON Web Token based authentication for Django REST framework,this use to WeChat applet (小程序使用jwt)
Project description
drf-jwt-wechat 是在jwt,跟rest_framework_jwt基础上进行修改过的,用于微信小程序登录, 前端只需post方法传code即可进行jwt登录验证
Usage
在django项目settings中添加修改APP_ID=xxxx,APP_SECRET=xxxxx,以及跟rest_framework_jwt包同样配置如下
REST_FRAMEWORK = { 'DEFAULT_PERMISSION_CLASSES': ( 'rest_framework.permissions.IsAuthenticated', ), 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework_jwt.authentication.JSONWebTokenAuthentication', 'rest_framework.authentication.SessionAuthentication', 'rest_framework.authentication.BasicAuthentication', ),
在url中引用
from drf-jwt-wechat.views import obtain_jwt_token #... urlpatterns = [ '', # ... url(r'^api-token-auth/', obtain_jwt_token), ]
后续
因为水平有限,目前只有登录,没有Refresh Token,以及Verify Token,不影响rest_framework_jwt的api使用。 任何问题请联系 https://github.com/liazylee/ 源码详解 https://blog.csdn.net/liazylee/article/details/90717939
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
drf-jwt-wechat-1.11.5.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for drf_jwt_wechat-1.11.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ce4023a6196c1628d8fd32d5fba839c0a9b4793533b56b4883859f60c9024bd |
|
MD5 | bd0d9b86e0f264268d4ceb23d4c5745d |
|
BLAKE2b-256 | 610e1b33482914f62ceb9d586cfde3a35bbaf7095b8bf62ff554d9e24b1ca915 |