i want to import from jwt but got an error line 12, in from rest_framework_jwt.settings import api_settings ModuleNotFoundError: No module named 'rest_framework_jwt'
CodePudding user response:
For python 3
pip3 install djangorestframework-jwt
For python 2 and python
pip install djangorestframework-jwt
CodePudding user response:
Verify your installation, it's a separated package: pip install djangorestframework-jwt
Also, try to include this in the settings.py: REST_FRAMEWORK = { 'DEFAULT_PERMISSION_CLASSES': ( 'rest_framework.permissions.IsAuthenticated', ), 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework_jwt.authentication.JSONWebTokenAuthentication', 'rest_framework.authentication.SessionAuthentication', 'rest_framework.authentication.BasicAuthentication', ), }