What is the difference between users_user_permissions and auth_permission and auth_group_permissions?
Django's schema for automatically generating table names is explained here . Basically, it uses the app_model template. In the case of ManyToManyFields, which are implemented by creating a new table to hold the relationship, this becomes app_model1_model2s.
So:
auth_permission is a table representing the model auth.Permission
.
auth_group_permissions is a table that represents the ManyToMany relationships between auth.Group
and auth.Permission
.
users_user_permissions is a table that represents ManyToManyField
between users.User
and auth.Permission
. (I am assuming this is coming from the application you are using? The Django version contrib.auth
should be auth_user_user_permissions
.)
See the documentation for how these tables are actually used.
source to share