diff --git a/django/middleware/csrf.py b/django/middleware/csrf.py
index fd8ff30..bbc34df 100644
a
|
b
|
class CsrfViewMiddleware(object):
|
169 | 169 | # Check non-cookie token for match. |
170 | 170 | request_csrf_token = "" |
171 | 171 | if request.method == "POST": |
172 | | request_csrf_token = request.POST.get('csrfmiddlewaretoken', '') |
| 172 | request_csrf_token = request.POST.get(settings.CSRF_INPUT_NAME, '') |
173 | 173 | |
174 | 174 | if request_csrf_token == "": |
175 | 175 | # Fall back to X-CSRFToken, to make things easier for AJAX, |
diff --git a/django/conf/global_settings.py b/django/conf/global_settings.py
index bd85c12..8739399 100644
a
|
b
|
SIGNING_BACKEND = 'django.core.signing.TimestampSigner'
|
531 | 531 | CSRF_FAILURE_VIEW = 'django.views.csrf.csrf_failure' |
532 | 532 | |
533 | 533 | # Settings for CSRF cookie. |
| 534 | CSRF_INPUT_NAME = 'csrfmiddlewaretoken' |
534 | 535 | CSRF_COOKIE_NAME = 'csrftoken' |
535 | 536 | CSRF_COOKIE_DOMAIN = None |
536 | 537 | CSRF_COOKIE_PATH = '/' |
diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py
index 954c5d6..ff21bff 100644
a
|
b
|
class CsrfTokenNode(Node):
|
45 | 45 | if csrf_token == 'NOTPROVIDED': |
46 | 46 | return mark_safe(u"") |
47 | 47 | else: |
48 | | return mark_safe(u"<div style='display:none'><input type='hidden' name='csrfmiddlewaretoken' value='%s' /></div>" % csrf_token) |
| 48 | return mark_safe(u"<div style='display:none'><input type='hidden' name='%s' value='%s' /></div>" % (settings.CSRF_INPUT_NAME, csrf_token)) |
49 | 49 | else: |
50 | 50 | # It's very probable that the token is missing because of |
51 | 51 | # misconfiguration, so we raise a warning |
52 | | from django.conf import settings |
53 | 52 | if settings.DEBUG: |
54 | 53 | import warnings |
55 | 54 | warnings.warn("A {% csrf_token %} was used in a template, but the context did not provide the value. This is usually caused by not using RequestContext.") |