Django Auth Database Schema Diagram
Django's built-in auth app creates a set of authentication tables when you run migrate: auth_user, auth_group, auth_permission, plus the many-to-many join tables auth_user_groups, auth_user_user_permissions, and auth_group_permissions. This diagram maps the full schema — including how permissions link to content types through django_content_type, and how admin actions are logged in django_admin_log.
Tables in the Django schema
| Column | Type | Nullable | Key |
|---|---|---|---|
| auth_user | |||
| id | integer | No | PK |
| password | varchar(128) | No | — |
| last_login | timestamp | Yes | — |
| is_superuser | boolean | No | — |
| username | varchar(150) | No | — |
| first_name | varchar(150) | No | — |
| last_name | varchar(150) | No | — |
| varchar(254) | Yes | — | |
| is_staff | boolean | No | — |
| is_active | boolean | No | — |
| date_joined | timestamp | No | — |
| auth_group | |||
| id | integer | No | PK |
| name | varchar(150) | No | — |
| auth_permission | |||
| id | integer | No | PK |
| name | varchar(255) | No | — |
| content_type_id | integer | No | — |
| codename | varchar(100) | No | — |
| auth_user_groups | |||
| id | integer | No | PK |
| user_id | integer | No | — |
| group_id | integer | No | — |
| auth_user_user_permissions | |||
| id | integer | No | PK |
| user_id | integer | No | — |
| permission_id | integer | No | — |
| auth_group_permissions | |||
| id | integer | No | PK |
| group_id | integer | No | — |
| permission_id | integer | No | — |
| django_content_type | |||
| id | integer | No | PK |
| app_label | varchar(100) | No | — |
| model | varchar(100) | No | — |
| django_admin_log | |||
| id | integer | No | PK |
| action_time | timestamp | No | — |
| object_id | text | Yes | — |
| object_repr | varchar(200) | No | — |
| action_flag | smallint | No | — |
| change_message | text | No | — |
| content_type_id | integer | Yes | — |
| user_id | integer | No | — |
| django_session | |||
| session_key | varchar(40) | No | PK |
| session_data | text | No | — |
| expire_date | timestamp | No | — |
Frequently asked questions
What tables does Django auth create?
Django's auth app creates auth_user, auth_group, auth_permission, and three many-to-many join tables: auth_user_groups, auth_user_user_permissions, and auth_group_permissions.
How do Django users relate to groups and permissions?
Users relate to groups through the auth_user_groups join table and to permissions through auth_user_user_permissions. Groups relate to permissions through auth_group_permissions. All three are many-to-many relationships.
Visualize your own database
Paste your PostgreSQL connection string and get an interactive ER diagram of your own schema in under 10 seconds. No signup required.
Try it free →