July 2018
Intermediate to advanced
324 pages
8h 14m
English
Once you are done with the installation, you need to add some predefined classes related to permission and authentication in settings.py as shown in the following code snippet.
File—settings.py:
REST_FRAMEWORK = { 'DEFAULT_RENDERER_CLASSES': ( 'rest_framework.renderers.JSONRenderer', ), 'DEFAULT_PERMISSION_CLASSES': ( 'rest_framework.permissions.IsAuthenticated', ), 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework_jwt.authentication.JSONWebTokenAuthentication', 'rest_framework.authentication.SessionAuthentication', 'rest_framework.authentication.BasicAuthentication', ),}
Now we need to append the URL for obtaining a token, based on user credentials. In the root urls.py, we will be appending the following ...
Read now
Unlock full access