Search code examples
pythondjangodjango-rest-frameworkjwtdjango-rest-framework-simplejwt

Cannot add "simplejwt.token_blacklist" to install apps


Hi I'm having an issue with restframework_simplejwt library. When I add blacklisting to installed apps ir returns me an error.

settings.py file:

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

error:

django.db.utils.ProgrammingError: relation "token_blacklist_outstandingtoken" does not exist
LINE 1: INSERT INTO "token_blacklist_outstandingtoken" ("user_id", "...

Solution

  • I realized that after adding the app to INSTALLED_APPS I didn't migrate the changes .

    python manage.py migrate and problem solved.

    Simple JWT docs gives us the necesary steps for this action.