Handling get and post Methods
Route HTTP verbs to class methods.
Verbs Become Methods
In a CBV, each HTTP verb maps to a method. A GET request runs your get method; a POST request runs your post method.
Subclass the Base View
For full control over verbs, subclass the base View class. You then define exactly the methods you want to support.
class ContactView(View):
passAll lessons in this course
- From Function Views to View Classes
- TemplateView and get_context_data
- Handling get and post Methods
- Mixins and as_view()