November 2015
Beginner to intermediate
840 pages
26h 30m
English
A CBV is simply a class that inherits View and meets the basic requirements of being a Django view: a view is a Python callable that always accepts an HttpRequest object and always returns an HttpResponse object.
The CBV organizes view behavior for a URI or set of URIs (when using named groups in a regular expression pattern) according to HTTP methods. Specifically, View is built such that it expects us to define any of the following: get(), post(), put(), patch(), delete(), trace(). We could additionally define head(), options(), but View will automatically generate these for us (for head() to be automatically generated, we must define get()).
Internally, the CBV actually steps through multiple view methods for ...
Read now
Unlock full access