{{ main }}
+{% if no_referer %} +{{ no_referer1 }}
+{{ no_referer2 }}
+{{ no_referer3 }}
+{% endif %} +{% if no_cookie %} +{{ no_cookie1 }}
+{{ no_cookie2 }}
+{% endif %} +Reason given for failure:
+
+ {{ reason }}
+
+ {% endif %}
+
+ In general, this can occur when there is a genuine Cross Site Request Forgery, or when + Django’s + CSRF mechanism has not been used correctly. For POST forms, you need to + ensure:
+ +request to the template’s render
+ method.{% templatetag openblock %} csrf_token
+ {% templatetag closeblock %} template tag inside each POST form that
+ targets an internal URL.CsrfViewMiddleware, then you must use
+ csrf_protect on any views that use the csrf_token
+ template tag, as well as those that accept the POST data.You’re seeing the help section of this page because you have DEBUG =
+ True in your Django settings file. Change that to False,
+ and only the initial error message will be displayed.
You can customize this page using the CSRF_FAILURE_VIEW setting.
+{{ more }}
+{{ reason }}{% endif %}
+ | Request Method: | +{{ request.META.REQUEST_METHOD }} | +
|---|---|
| Request URL: | +{{ request.build_absolute_uri }} | +
| Raised by: | +{{ raising_view_name }} | +
+ Using the URLconf defined in {{ urlconf }},
+ Django tried these URL patterns, in this order:
+
+ {% if request_path %}
+ The current path, {{ request_path }},
+ {% else %}
+ The empty path
+ {% endif %}
+ {% if resolved %}matched the last one.{% else %}didn’t match any of these.{% endif %}
+
+ You’re seeing this error because you have DEBUG = True in
+ your Django settings file. Change that to False, and Django
+ will display a standard 404 page.
+
{% if exception_value %}{{ exception_value|force_escape }}{% if exception_notes %}{{ exception_notes }}{% endif %}{% else %}No exception message supplied{% endif %}
+ | Request Method: | +{{ request.META.REQUEST_METHOD }} | +
|---|---|
| Request URL: | +{{ request_insecure_uri }} | +
| Django Version: | +{{ django_version_info }} | +
| Exception Type: | +{{ exception_type }} | +
| Exception Value: | +{{ exception_value|force_escape }} |
+
| Exception Location: | +{{ lastframe.filename }}, line {{ lastframe.lineno }}, in {{ lastframe.function }} | +
| Raised during: | +{{ raising_view_name }} | +
| Python Executable: | +{{ sys_executable }} | +
| Python Version: | +{{ sys_version_info }} | +
| Python Path: | +{{ sys_path|pprint }} |
+
| Server time: | +{{server_time|date:"r"}} | +
The string that could not be encoded/decoded was: {{ unicode_hint }}
+Django tried loading these templates, in this order:
+ {% for entry in postmortem %} +Using engine {{ entry.backend.name }}:
{{ attempt.0.loader_name }}: {{ attempt.0.name }} ({{ attempt.1 }})No templates were found because your 'TEMPLATES' setting is not configured.
+ {% endif %} +In template {{ template_info.name }}, error at line {{ template_info.line }}
| {{ source_line.0 }} | +{{ template_info.before }}{{ template_info.during }}{{ template_info.after }} | +
|---|---|
| {{ source_line.0 }} | +{{ source_line.1 }} |
{{ frame.filename }}, line {{ frame.lineno }}, in {{ frame.function }}
+ {% elif forloop.first %}
+ None
+ {% else %}
+ Traceback: None
+ {% endif %}
+
+ {% if frame.context_line %}
+ {{ line }}{{ frame.context_line }}{{ frame.colno }}{% if not is_email %} …{% endif %}{{ line }}| Variable | +Value | +
|---|---|
| {{ var.0 }} | +{{ var.1 }} |
+
{{ user_str }}
+ {% endif %} + +| Variable | +Value | +
|---|---|
| {{ k }} | +{{ v|pprint }} |
+
No GET data
+ {% endif %} + +| Variable | +Value | +
|---|---|
| {{ k }} | +{{ v|pprint }} |
+
No POST data
+ {% endif %} + +| Variable | +Value | +
|---|---|
| {{ k }} | +{{ v|pprint }} |
+
No FILES data
+ {% endif %} + +| Variable | +Value | +
|---|---|
| {{ k }} | +{{ v|pprint }} |
+
No cookie data
+ {% endif %} + +| Variable | +Value | +
|---|---|
| {{ k }} | +{{ v|pprint }} |
+
Request data not supplied
+{% endif %} + +{{ settings.SETTINGS_MODULE }}| Setting | +Value | +
|---|---|
| {{ k }} | +{{ v|pprint }} |
+
+ You’re seeing this error because you have DEBUG = True in your
+ Django settings file. Change that to False, and Django will
+ display a standard page generated by the handler for this status code.
+
{{ last_updated }}
+{{ last_updated }}
+ {%- endif %} +