<aside> π§©
This page describes the standard Django user model (django.contrib.auth.models.User) and its key fields. Below is a quick reference and detailed explanations.
</aside>
| Field | Type | Purpose | Key properties |
|---|---|---|---|
| username | CharField | Unique user login | max_length=150, unique=True |
| first_name | CharField | First name | max_length=150, non-unique, optional |
| last_name | CharField | Last name | max_length=150, non-unique, optional |
| EmailField | Email address | max_lengthβ254, format validation, usually optional | |
| password | CharField | Password hash | max_length=128, set_password(), PBKDF2 by default |
| is_staff | BooleanField | Access to /admin | default=False |
| is_active | BooleanField | Account active | default=True |
| is_superuser | BooleanField | Full permissions | default=False |
| last_login | DateTimeField | Last sign-in | auto-updated on login, may be null |
| date_joined | DateTimeField | Account creation time | default=timezone.now, null=False |