From Function Views to View Classes
Why CBVs exist and when to use them.
Two Ways to Build Views
So far your views were plain functions. Django also lets you write views as classes, which package related logic together neatly.
What a Class-Based View Is
A class-based view (CBV) is just a Python class that handles a request. Django turns it into a callable for you behind the scenes.
All lessons in this course
- From Function Views to View Classes
- TemplateView and get_context_data
- Handling get and post Methods
- Mixins and as_view()