May 2023
Intermediate to advanced
764 pages
17h 57m
English
In Chapter 3, URL Mapping, Views, and Templates, we learned how to build views and create templates in Django. Then, we learned how to use those views to render the templates we built. In this chapter, we will build upon our knowledge of developing views by using class-based views, allowing us to write views that can group logical methods into a single entity. This skill comes in handy when developing a view that maps to multiple HTTP request methods for the same application programming interface (API) endpoint. With method-based views, we may end up using a lot of the if-else conditions to successfully handle the different types of HTTP request methods. In contrast, class-based views allow us to ...
Read now
Unlock full access