Django asks to migrate an unknown app: authtoken

Recently I got this message on running the server.
You have 1 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): authtoken.

The git branch is unchanged, no recent commit contains any authtoken relations.

rest_framework.authtoken is part of INSTALLED_APPS since a long time, but as said, no recent changes relate to it.

How can I discover what is causing this message in order to get rid of it?

The answer is easy:

rest_framework.authtoken is an application with models and its own migrations.

You can find the reason here: https://github.com/encode/django-rest-framework/tree/master/rest_framework/authtoken/migrations

These are the 4 db migrations you need to do before you can use rest_framework.authtoken.

To get rid of this - you need to run the standard management command:

python manage.py migrate

This is specifically mentioned in the documentation for rest_framework.authtoken here: https://www.django-rest-framework.org/api-guide/authentication/#tokenauthentication

Back to Top