一、安装

pip install djangorestframework-jwt

二、使用

REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': (
        'rest_framework.authentication.BasicAuthentication',
        'rest_framework.authentication.SessionAuthentication',
        'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
    )
}

三、url

# jwt的token认证接口
path('jwt-auth/', obtain_jwt_token )

四、postman

DRF的json web token方式完成用户认证

相关文章:

  • 2021-06-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2021-08-25
  • 2022-01-14
  • 2021-06-18
猜你喜欢
  • 2021-05-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-23
  • 2022-12-23
相关资源
相似解决方案