DRF with JWT
I. Prerequisites
1. Install REST framework JWT Auth package
pip install djangorestframework-jwt2. Change settings.py configuration
settings.py configuration(1) Change REST_FRAMEWORK configuration
REST_FRAMEWORK configurationREST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework_jwt.authentication.JSONWebTokenAuthentication', # Replace from Token
# 'rest_framework.authentication.TokenAuthentication',
]
}(2) Add REST_USE_JWT configuration
REST_USE_JWT configuration(3) Add JWT_AUTH configuration
JWT_AUTH configurationII. All changes
settings.py
settings.pyLast updated