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.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.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

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.TemplateView

class django.views.generic.base.TemplateView Renders a given template, with the context containing parameters captured in the URL. Ancestors (MRO) This view inherits methods and attributes from the following views: django.views.generic.base.TemplateResponseMixin django.views.generic.base.ContextMixin django.views.generic.base.View Method Flowchart dispatch() http_method_not_allowed() get_context_data() Example views.py: from django.views.generic.base import TemplateView from articles.mo

views.generic.base.TemplateResponseMixin.template_name

template_name The full name of a template to use as defined by a string. Not defining a template_name will raise a django.core.exceptions.ImproperlyConfigured exception.

views.generic.base.TemplateResponseMixin.template_engine

template_engine The NAME of a template engine to use for loading the template. template_engine is passed as the using keyword argument to response_class. Default is None, which tells Django to search for the template in all configured engines.

views.generic.base.TemplateResponseMixin.response_class

response_class The response class to be returned by render_to_response method. Default is TemplateResponse. The template and context of TemplateResponse instances can be altered later (e.g. in template response middleware). If you need custom template loading or custom context object instantiation, create a TemplateResponse subclass and assign it to response_class.

views.generic.base.TemplateResponseMixin.render_to_response()

render_to_response(context, **response_kwargs) Returns a self.response_class instance. If any keyword arguments are provided, they will be passed to the constructor of the response class. Calls get_template_names() to obtain the list of template names that will be searched looking for an existent template.

views.generic.base.TemplateResponseMixin.get_template_names()

get_template_names() Returns a list of template names to search for when rendering the template. The first template that is found will be used. If template_name is specified, the default implementation will return a list containing template_name (if it is specified).