views.generic.dates.BaseDateDetailView

class BaseDateDetailView [source]

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

permanent Whether the redirect should be permanent. The only difference here is the HTTP status code returned. If True, then the redirect will use status code 301. If False, then the redirect will use status code 302. By default, permanent is False. Changed in Django 1.9: The default value of the permanent attribute changed from True to False.