As soon as an application has users, it needs to answer two questions: who is this person (authentication) and what are they allowed to do (authorization). Django ships with a complete auth system that handles user accounts, password hashing, sessions, and permissions, so you do not have to build any of it from scratch.
In this module you will learn how to let people register,
log in, and log out using the built-in
User model and auth views. You will then learn how to protect pages
with login_required and LoginRequiredMixin, and how
permissions control who can view or change specific content.
Watch the lessons in order, then continue on to REST APIs with Django REST Framework. Some of these videos were recorded on older Django releases, so check the official documentation if a detail differs on your install.
Corey Schafer builds a user registration page, using Django forms to create new accounts.
Corey Schafer adds login and logout using the built-in authentication views.
Covers creating login and logout pages and authenticating users with the built-in auth system.
Shows how to restrict access to pages using Django permissions and the login required mixin.