how to load user from jwt token request django
- Install the
djangorestframework
and djangorestframework_simplejwt
packages. - Add
'rest_framework'
and 'rest_framework_simplejwt'
to your INSTALLED_APPS
in the project's settings. - Include
'rest_framework_simplejwt.authentication.JWTAuthentication'
in the DEFAULT_AUTHENTICATION_CLASSES
. - Use the
decode
method of rest_framework_simplejwt.tokens.AccessToken
to decode the JWT token and retrieve the user information.