Other than auth_user, I have never used auth_group, auth_group_permissions, auth_permission, auth_user_user_permissions, and auth_user_user_permissions. What are the specific uses for each of these models? Is it common that one would not need any of these? If so, what would be the best way to get rid of them (doing a straight DROP TABLE or at the django-level)? Would there ever be a downside of removing these?
Other than auth_user , I have never used auth_group , auth_group_permissions , auth_permission ,
Share
I’d recommend reading the User authentication section in the Django documentation. It describes the components of the auth system as:
The simplest use of permissions is to control the actions a certain user can take in the Django Admin site. You can also use permissions to restrict access to your own views using the
django.contrib.auth.decorators.permission_requireddecorator.When this is combined with groups you can easily assign the same permissions to a whole group of users.
The other database tables you mention (
auth_group_permissions, etc.) store the relationships between users and permissions or groups and permissions.While you may not be using these parts of the authentication system directly you are almost certainly using other code from
django.contrib.auththat relies on them. If you’re using an app you didn’t write (whether it’s part of Django or not) then it’s probably a bad idea to drop the database tables that app creates.