小编sli*_*ger的帖子

ModuleNotFoundError:没有名为“rest_framework_simplejwt.token_blacklistauthentication”的模块

我遇到了由 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)

django-rest-framework django-rest-framework-simplejwt

8
推荐指数
2
解决办法
2万
查看次数