Views¶
-
class
missing.views.
EnsureCsrfCookieMixin
¶ Mixin for Django class-based views which forces a view to send the CSRF cookie.
This is useful when using Ajax-based sites which do not have an HTML form with a
csrf_token
that would cause the required CSRF cookie to be sent.
-
missing.views.
bad_request_view
(request, exception=None)¶ Displays 400 bad request page.
It is similar to the Django built-in
django.views.defaults.permission_denied
view, but always uses a template and a request context. You can configure Django to use this view by adding tourls.py
:handler400 = 'missing.views.bad_request_view'
Template should not require a CSRF token.
-
missing.views.
forbidden_view
(request, exception=None, reason='')¶ Displays 403 forbidden page. For example, when request fails CSRF protection.
It is similar to a merged Django built-in
django.views.defaults.permission_denied
anddjango.views.csrf.csrf_failure
views, but always uses a template and a request context. You can configure Django to use this view by adding tourls.py
:handler403 = 'missing.views.forbidden_view'
and to
settings.py
:CSRF_FAILURE_VIEW = 'missing.views.forbidden_view'
Template should not require a CSRF token.