0
0
Djangoframework~5 mins

User model overview in Django - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of the User model in Django?
The User model in Django represents a person who can log into the website. It stores information like username, password, email, and permissions.
Click to reveal answer
intermediate
Name two ways to customize the User model in Django.
You can customize the User model by either extending AbstractUser or by creating a completely new model using AbstractBaseUser.
Click to reveal answer
beginner
What fields are included by default in Django's built-in User model?
The default User model includes username, password, email, first_name, last_name, is_staff, is_active, and date_joined.
Click to reveal answer
beginner
How does Django handle password security in the User model?
Django stores passwords in a hashed format using strong algorithms, so the actual password is never saved in plain text.
Click to reveal answer
intermediate
What is the role of the AUTH_USER_MODEL setting in Django?
AUTH_USER_MODEL tells Django which User model to use. It allows you to replace the default User model with a custom one.
Click to reveal answer
Which Django model is used by default to represent users?
Adjango.contrib.admin.models.AdminUser
Bdjango.db.models.Model
Cdjango.contrib.sessions.models.Session
Ddjango.contrib.auth.models.User
Which method is recommended to create a fully custom user model?
AExtend AbstractBaseUser
BExtend AbstractUser
CUse the default User model without changes
DCreate a model unrelated to AbstractBaseUser
What does the is_staff field indicate in the User model?
AIf the user is active
BIf the user can log in to the admin site
CIf the user has a verified email
DIf the user is a superuser
How are passwords stored in Django's User model?
APlain text
BEncrypted with reversible encryption
CHashed with a secure algorithm
DNot stored at all
What setting do you change to use a custom User model?
AAUTH_USER_MODEL
BUSER_MODEL
CCUSTOM_USER
DUSER_AUTH_MODEL
Explain the difference between extending AbstractUser and AbstractBaseUser when customizing the User model.
Think about how much you want to change the default user.
You got /4 concepts.
    Describe how Django ensures password security in the User model.
    Focus on how passwords are saved safely.
    You got /4 concepts.