Learning the basics of Django authentication
The first concern any user has while using an application in today’s world is, Is my data secure with the application? This is also the most important thing a developer should keep in mind – always develop a secure application. So, what does secure mean? Security can come into multiple levels, such as authentication, authorization, server security (that is, the server where the application is running is secure), and so on. In this chapter, we will focus on the most fundamental part of security, application authentication; that is, via a login. Django comes with a built-in authentication framework.
The batteries-included approach of Django provides an authentication system out of the box that gives us a basic user model that is plugged with session- (cookie)-based authentication. When we create a new Django project, by default, Django includes django.contrib.auth
and django.contrib.sessions
in the INSTALLED_APPS
section of...