May 2018
Beginner to intermediate
526 pages
11h 57m
English
Class-based views are an alternative way to implement views as Python objects instead of functions. Since a view is a callable that takes a web request and returns a web response, you can also define your views as class methods. Django provides base view classes for this. All of them inherit from the View class, which handles HTTP method dispatching and other common functionalities.
Class-based views offer advantages over function-based views for some use cases. They have the following features:
You can take ...
Read now
Unlock full access