0PricingLogin
Django Academy · Lesson

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):
    pass

All lessons in this course

  1. From Function Views to View Classes
  2. TemplateView and get_context_data
  3. Handling get and post Methods
  4. Mixins and as_view()
← Back to Django Academy