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

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