1 djangorestframework-jwt使用
安装
pip install djangorestframework-jwt
在settings.py中进行配置
from datetime import timedelta
JWT_AUTH = {
"JWT_EXPIRATION_DELTA": timedelta(days=2),
"JWT_RESPONSE_PAYLOAD_HANDLER": "users.utils.jwt_response_payload_handler"
}
设置路由