sli*_*ger 8 django-rest-framework django-rest-framework-simplejwt
我遇到了由 simplejwt 框架引起的错误。
ModuleNotFoundError: No module named 'rest_framework_simplejwt.token_blacklistauthentication'
Run Code Online (Sandbox Code Playgroud)
我想将使用过的刷新令牌列入黑名单(刷新后)。simplejwt 工作完美,但似乎存在一个由以下原因引起的问题'rest_framework_simplejwt.token_blacklist'
这是我的rest_framework配置:
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.IsAuthenticated',
],
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.SessionAuthentication',
'rest_framework_simplejwt.authentication.JWTAuthentication',
]
}
Run Code Online (Sandbox Code Playgroud)
你试过这个吗
pip install --upgrade djangorestframework-simplejwt
Run Code Online (Sandbox Code Playgroud)
我的问题是
ModuleNotFoundError:没有名为“rest_framework_simplejwt”的模块
错误出现在 djangorestframework-simplejwt 版本中;或者您可以在ImportError: Could not import 'rest_framework_simplejwt.authentication.JWTAuthentication'阅读更多内容
| 归档时间: |
|
| 查看次数: |
20111 次 |
| 最近记录: |