From the course: Introduction to Django
Unlock this course with a free trial
Join today to access over 24,400 courses taught by industry experts.
The user model - Django Tutorial
From the course: Introduction to Django
The user model
- Okay, so now let's talk about our user model. The built-in authentication app that comes with Django does have a default user model, and you can access it in this way, but there's some potential problems with it, the first being that the default is to log in with a username and password. But most apps or websites these days require an email and password instead, because, you know, you're going to remember your email more than your username. So that's one thing that often you would want to change. Another one is you usually want to add additional fields to the user model that are specific to your site, because the default one has a bunch of fields in it, but not necessarily all the ones that you would actually care about. It's more for kind of the admin site. It's a very good idea to create a custom user instead of using the default one by inheriting from the AbstractUser. You know, you can start off with a default user, but then you'd have to add on a way to attach more fields that…
Contents
-
-
-
-
-
-
(Locked)
Django architecture10m 45s
-
(Locked)
Django project structures6m 55s
-
(Locked)
Example project overview7m 53s
-
(Locked)
Deployment settings16m 17s
-
(Locked)
Django ORM: Models10m 10s
-
(Locked)
Django ORM: Queries15m 39s
-
(Locked)
Django ORM: Migrations5m 19s
-
(Locked)
The user model7m 37s
-
(Locked)
URLs8m 50s
-
(Locked)
Views11m 20s
-
(Locked)
Class-based views3m 38s
-
(Locked)
Admin8m 19s
-
(Locked)
Front end5m 14s
-
(Locked)
Templates8m 7s
-
(Locked)
Forms8m 17s
-
(Locked)
-