A class-based view (CBV) implements a Django view with a Python class rather than a function. Django supplies reusable view classes, and you can use them directly or inherit from them to define your own. section 14.1
The practical appeal is organization: when a view handles several HTTP methods, one class method can represent each action. That can reduce code, although the approach is more abstract than a function-based view. section 14.1
Use a CBV when:
- You want Django-provided classes to supply reusable view behavior. section 14.1
- You prefer grouping several HTTP-method actions inside one class. section 14.1
- You are willing to trade some function-level simplicity for framework conventions and reuse. section 14.1
Django Admin pages
CBVs can add pages to the Django Admin navigation, such as an administrator-only report. Related admin extensions can also support specialized filters, links, buttons, wizards, and bulk operations. section 14.4
