drf-jwt-wechat
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
Release files for drf-jwt-wechat 1.11.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| drf_jwt_wechat-1.11.9.tar.gz | 4.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| drf_jwt_wechat-1.11.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.0 kB
Release files / drf_jwt_wechat-1.11.9.tar.gz
| Download URL | drf_jwt_wechat-1.11.9.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dda2c2f0738890757d95f2baf1110da57ac9dc62172f96cf40345449f0e19f7f
|
|
BLAKE2b-256 checksum How to use checksums |
99ede71d68fcddbd3a1de9a4a235c97abacf1d5e0eadd95beada5e2aed4b25a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7
|
Release files / drf_jwt_wechat-1.11.9-py3-none-any.whl
| Download URL | drf_jwt_wechat-1.11.9-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b185882d192d994b99ff42fea7fc73309296d7400b27604896c35cb27eda82e2
|
|
BLAKE2b-256 checksum How to use checksums |
b223b5dbd26744c10a066fdeefb75420a00200ad275e2309045982d9cc5d3cbb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7
|