views.generic.base.View

class django.views.generic.base.View The master class-based base view. All other class-based views inherit from this base class. It isn’t strictly a generic view and thus can also be imported from django.views. Changed in Django 1.10: The ability to import from django.views was added. Method Flowchart dispatch() http_method_not_allowed() options() Example views.py: from django.http import HttpResponse from django.views import View class MyView(View): def get(self, request, *args, *

views.generic.base.View.dispatch()

dispatch(request, *args, **kwargs) The view part of the view – the method that accepts a request argument plus arguments, and returns a HTTP response. The default implementation will inspect the HTTP method and attempt to delegate to a method that matches the HTTP method; a GET will be delegated to get(), a POST to post(), and so on. By default, a HEAD request will be delegated to get(). If you need to handle HEAD requests in a different way than GET, you can override the head() method. See

views.generic.base.View.http_method_names

http_method_names The list of HTTP method names that this view will accept. Default: ['get', 'post', 'put', 'patch', 'delete', 'head', 'options', 'trace'] Methods

views.generic.base.View.http_method_not_allowed()

http_method_not_allowed(request, *args, **kwargs) If the view was called with a HTTP method it doesn’t support, this method is called instead. The default implementation returns HttpResponseNotAllowed with a list of allowed methods in plain text.

views.generic.base.View.options()

options(request, *args, **kwargs) Handles responding to requests for the OPTIONS HTTP verb. Returns a response with the Allow header containing a list of the view’s allowed HTTP method names.

views.generic.dates.ArchiveIndexView

class ArchiveIndexView [source] A top-level index page showing the “latest” objects, by date. Objects with a date in the future are not included unless you set allow_future to True. Ancestors (MRO) django.views.generic.list.MultipleObjectTemplateResponseMixin django.views.generic.base.TemplateResponseMixin django.views.generic.dates.BaseArchiveIndexView django.views.generic.dates.BaseDateListView django.views.generic.list.MultipleObjectMixin django.views.generic.dates.DateMixin django.views.

views.generic.dates.BaseArchiveIndexView

class BaseArchiveIndexView [source]

views.generic.dates.BaseDateDetailView

class BaseDateDetailView [source]

views.generic.dates.BaseDateListView

class BaseDateListView [source] A base class that provides common behavior for all date-based views. There won’t normally be a reason to instantiate BaseDateListView; instantiate one of the subclasses instead. While this view (and its subclasses) are executing, self.object_list will contain the list of objects that the view is operating upon, and self.date_list will contain the list of dates for which data is available. Mixins DateMixin MultipleObjectMixin Methods and Attributes allow_emp

views.generic.dates.BaseDateListView.allow_empty

allow_empty A boolean specifying whether to display the page if no objects are available. If this is True and no objects are available, the view will display an empty page instead of raising a 404. This is identical to django.views.generic.list.MultipleObjectMixin.allow_empty, except for the default value, which is False.