ModuleNotFoundError: No module named 'rest_framework_simplejwt.token_blacklistauthentication'

Viewed 1059

Am experiencing this error caused by the simplejwt framework.

ModuleNotFoundError: No module named 'rest_framework_simplejwt.token_blacklistauthentication'

i want to blacklist used refresh tokens(after refresh).The simplejwt works perfectly but it seems there is an issue caused by:

'rest_framework_simplejwt.token_blacklist'

here are my rest_framework configs:

REST_FRAMEWORK = {
    'DEFAULT_PERMISSION_CLASSES': [
        'rest_framework.permissions.IsAuthenticated', 
     ],
      'DEFAULT_AUTHENTICATION_CLASSES': [
        'rest_framework.authentication.SessionAuthentication',
        'rest_framework_simplejwt.authentication.JWTAuthentication',
    ]

}

2 Answers

You have to put the 'Blacklist' app in installed apps:

INSTALLED_APPS = ['rest_framework_simplejwt.token_blacklist', ...]

The documentation explain it: Blacklisted app.

Related