- Published on
Django Authentication
- Authors
- Name
Authentication
- who the user from the request is:This can be based on sessions(cookies), tokens, or other methods.
request.user
- who the user from the request is:
Authorization
- what the user is allowed to do
- Permissions
- Groups
- Object-level permissions (e.g., Django Guardian)
- what the user is allowed to do
Built-in Authentication
django.contrib.auth provides a robust authentication system out of the box.
User Model
Django includes a default User model with fields like username, password, email, first_name, last_name, etc. You can also create a custom user model by extending AbstractUser or AbstractBaseUser.