Answer the question
In order to leave comments, you need to log in
How to update model name in permission from auth in Django?
Good afternoon!
Recently, while looking at the list of permissions in the admin panel, I found that the model names in the permissions are outdated .
Here instead of a wordПредмет
there is a wordТовар
, and instead of a wordКвант
-quant
DB Browser for SQLite
(browser for SQLite) and found that the model names in the permission table (auth_permission) are stored directly in the database , and are not taken from the code. Answer the question
In order to leave comments, you need to log in
In general, I solved the problem as follows:
python3 manage.py shell
)from django.contrib.auth.models import Permission
Permission.objects.all().delete()
python3 manage.py makemigrations
python3 manage.py migrate
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question