Dango notes II: class-based views

  • A view is a callable which takes a request and returns a response.
  • A view can be function (function-based view) or a class (class-based view).
  • Class-based views allow you to structure your views and reuse code by harnessing inheritance and mixins.
  • There are two ways to configure or set class attributes:
    • to subclass and to override attributes and method in the subclass, and
    • to configure class attributes as keyword arguments to the as_view() call in the URLconf.
原文地址:https://www.cnblogs.com/Patt/p/7326505.html