<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>



User model at a glance


Fields overview

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
email 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

Field details

username β€” unique identifier

first_name β€” first name

last_name β€” last name

email β€” email address

password β€” password hash

is_staff β€” admin access

is_active β€” account active