I can't import the rest_framework_simplejwt in my django project specifically in my urls.py. I downgrade django to 3.0 and djangorestframework to 3.10 and still didnt work. the console shows me
{
"resource": "/c:/Dev/realest_estate2/backend/realest_estate/urls.py",
"owner": "python",
"code": "import-error",
"severity": 8,
"message": "Unable to import 'rest_framework_simplejwt.views'",
"source": "pylint",
"startLineNumber": 6,
"startColumn": 1,
"endLineNumber": 6,
"endColumn": 1
}
this is what im importing.
from rest_framework_simplejwt.views import (
TokenObtainPairView,
TokenRefreshView,
)
This is my configuration in my settings.py
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'corsheaders',
'rest_framework',
'accounts',
]
MIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.IsAuthenticated'
],
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework_simplejwt.authentication.JWTAuthentication',
]
}
and here is my pip freeze
asgiref==3.2.10
Django==3.0
django-cors-headers==3.4.0
djangorestframework==3.10.0
djangorestframework-simplejwt==4.4.0
Pillow==7.2.0
psycopg2==2.8.5
psycopg2-binary==2.8.5
PyJWT==1.7.1
pytz==2020.1
sqlparse==0.3.1
if you need more info please tell me and i will provide it. Thank you