How to update the model name in the permit (permission) from auth in Django?

Good day!
Recently, studying the list of permissions in the admin panel, I found that the names of the models in the permissions obsolete.
Here instead of the word Subject is the word Product, instead of the word Quantquant

I, without thinking, decided to look at database using DB Browser for SQLite (for SQLite browser) and found that the names of the models in the table permission (auth_permission) are stored directly in the database, and not taken from the code.

From all the above I learned that the names of the models in permits was generalise the first migration.

Question: how to update model names in resolutions up to the current state?

Thanks in advance.
March 19th 20 at 08:44
1 answer
March 19th 20 at 08:46
In General, solved the problem as follows:
  1. Remove all permissions manually:
    • either via shell Django (python3 shell)
      from django.contrib.auth.models import Permission

    • either through a database tool (like DB Browser for SQLite) to find the table with the name auth_permission (you may have more) and delete all the entries to hell.

  2. To make and apply the migration:
    python3 makemigrations
    python3 migrate

Find more questions by tags Django