middleware.csrf.CsrfViewMiddleware

class CsrfViewMiddleware [source] Adds protection against Cross Site Request Forgeries by adding hidden form fields to POST forms and checking requests for the correct value. See the Cross Site Request Forgery protection documentation.

middleware.common.CommonMiddleware.response_redirect_class

CommonMiddleware.response_redirect_class Defaults to HttpResponsePermanentRedirect. Subclass CommonMiddleware and override the attribute to customize the redirects issued by the middleware.

middleware.common.CommonMiddleware

class CommonMiddleware [source] Adds a few conveniences for perfectionists: Forbids access to user agents in the DISALLOWED_USER_AGENTS setting, which should be a list of compiled regular expression objects. Performs URL rewriting based on the APPEND_SLASH and PREPEND_WWW settings. If APPEND_SLASH is True and the initial URL doesn’t end with a slash, and it is not found in the URLconf, then a new URL is formed by appending a slash at the end. If this new URL is found in the URLconf, then D

middleware.common.BrokenLinkEmailsMiddleware

class BrokenLinkEmailsMiddleware [source] Sends broken link notification emails to MANAGERS (see Error reporting).

middleware.clickjacking.XFrameOptionsMiddleware

class XFrameOptionsMiddleware [source] Simple clickjacking protection via the X-Frame-Options header.

middleware.cache.UpdateCacheMiddleware

class UpdateCacheMiddleware [source]

middleware.cache.FetchFromCacheMiddleware

class FetchFromCacheMiddleware [source] Enable the site-wide cache. If these are enabled, each Django-powered page will be cached for as long as the CACHE_MIDDLEWARE_SECONDS setting defines. See the cache documentation.

messages.views.SuccessMessageMixin.get_success_message()

get_success_message(cleaned_data) cleaned_data is the cleaned data from the form which is used for string formatting

messages.views.SuccessMessageMixin

class views.SuccessMessageMixin Adds a success message attribute to FormView based classes get_success_message(cleaned_data) cleaned_data is the cleaned data from the form which is used for string formatting Example views.py: from django.contrib.messages.views import SuccessMessageMixin from django.views.generic.edit import CreateView from myapp.models import Author class AuthorCreate(SuccessMessageMixin, CreateView): model = Author success_url = '/success/' success_messag

messages.storage.session.SessionStorage

class storage.session.SessionStorage This class stores all messages inside of the request’s session. Therefore it requires Django’s contrib.sessions application.