Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import "rest_framework_simplejwt.authentication" could not be resolved Pylance (reportMissingImports) #788

Open
jbiddulph opened this issue Mar 12, 2024 · 2 comments
Labels

Comments

@jbiddulph
Copy link

this in my code doesn't seem to be working:

from rest_framework_simplejwt.authentication import JWTAuthentication

authentication_classes = [JWTAuthentication]

here's my requirements.txt:

asgiref>=3.7.2
django>=4.2.11
django-cors-headers>=4.3.1
djangorestframework>=3.14.0
djangorestframework-simplejwt==5.3.1
mysqlclient>=2.2.4
pillow>=10.2.0
pip>=24.0
PyJWT>=2.8.0
pytz>=2024.1
setuptools>=58.0.4
sqlparse>=0.4.4
typing_extensions>=4.10.0

I just keep getting 401 unauthorized:
{
"detail": "Given token not valid for any token type",
"code": "token_not_valid",
"messages": [
{
"token_class": "AccessToken",
"token_type": "access",
"message": "Token is invalid or expired"
}
]
}

@Andrew-Chen-Wang
Copy link
Member

giving a reproducible example would be helpful with detailed steps and code, thanks:)

@Andrew-Chen-Wang
Copy link
Member

Installing django-stubs will be helpful for pylance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants