diff --git a/django/views/csrf.py b/django/views/csrf.py
index c95d19d..e47176d 100644
a
|
b
|
CSRF_FAILURE_TEMPLATE = """
|
42 | 42 | re-enable them, at least for this site, or for HTTPS connections, or for |
43 | 43 | 'same-origin' requests.</p> |
44 | 44 | {% endif %} |
| 45 | {% if no_cookie %} |
| 46 | <p>You are seeing this message because this site requires a CSRF |
| 47 | cookie when submitting forms. This cookie is required for security |
| 48 | reasons, to ensure that your browser is not being hijacked by third |
| 49 | parties.</p> |
| 50 | |
| 51 | <p>If you have configured your browser to disable cookies, please |
| 52 | re-enable them, at least for this site, or for 'same-origin' requests.</p> |
| 53 | {% endif %} |
45 | 54 | </div> |
46 | 55 | {% if DEBUG %} |
47 | 56 | <div id="info"> |
… |
… |
def csrf_failure(request, reason=""):
|
95 | 104 | """ |
96 | 105 | Default view used when request fails CSRF protection |
97 | 106 | """ |
98 | | from django.middleware.csrf import REASON_NO_REFERER |
| 107 | from django.middleware.csrf import REASON_NO_REFERER, REASON_NO_CSRF_COOKIE |
99 | 108 | t = Template(CSRF_FAILURE_TEMPLATE) |
100 | 109 | c = Context({'DEBUG': settings.DEBUG, |
101 | 110 | 'reason': reason, |
102 | | 'no_referer': reason == REASON_NO_REFERER |
| 111 | 'no_referer': reason == REASON_NO_REFERER, |
| 112 | 'no_cookie': reason == REASON_NO_CSRF_COOKIE |
103 | 113 | }) |
104 | 114 | return HttpResponseForbidden(t.render(c), content_type='text/html') |