Perhaps I can help you implement JWT in your DRF project. I hope this gives you some clarity regarding the REST of your question.
In the project settings file, include jwt in INSTALLED_APPS
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'rest_framework.authtoken',
'rest_framework_swagger',
'rest_framework_jwt',
'django_filters',
'corsheaders',
'sslserver',
]
Then make this entry -
REST_FRAMEWORK = {
'DEFAULT_PAGINATION_CLASS': 'core.pagination.StandardPageNumberPagination',
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
'rest_framework.authentication.SessionAuthentication',
),
}
And then
JWT_AUTH = {
'JWT_SECRET_KEY': SECRET_KEY,
'JWT_GET_USER_SECRET_KEY': None,
'JWT_PUBLIC_KEY': None,
'JWT_PRIVATE_KEY': None,
'JWT_ALGORITHM': 'HS256',
'JWT_VERIFY': True,
'JWT_VERIFY_EXPIRATION': True,
'JWT_LEEWAY': 0,
'JWT_EXPIRATION_DELTA': datetime.timedelta(seconds=300),
'JWT_ALLOW_REFRESH': False,
'JWT_REFRESH_EXPIRATION_DELTA': datetime.timedelta(days=7),
}
Now, to understand what each of these settings does, see the documentation. And even then, if you need clarity on any of the points, I would be happy to explain.