Mastering Django Authentication and Authorization
In Chapter 4, we learned how to use Django Admin to autogenerate a user interface (UI) for basic CRUD operations. While working with Django Admin, we used the default Django authentication and authorization systems. In this chapter, we will deep dive into the Django authentication system and learn how to use Django groups and permissions to implement authorization for resources. Django by default provides cookie-based session authentication, which works perfectly for browser-based applications, but when it comes to modern web apps, it is preferred to use token-based authentication. Django REST framework (DRF) provides token-based authentication out of the box, and we will learn how to integrate DRF token-based authorization into our project along with social login.
In this chapter, we will cover the following main topics:
- Learning the basics of Django authentication
- Customizing the
User
model - Using a
OneToOneField...