From fc7237e150b5c4307bc74a43d797807f02742427 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Sun, 20 Jun 2010 11:38:01 +0200 Subject: [PATCH] remove CsrfResponseMiddleware and use csrf_tokens in the templates --- pyweb/mumble/templates/mumble/mumble.html | 8 ++++---- pyweb/settings.py | 1 - pyweb/templates/registration/login.html | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pyweb/mumble/templates/mumble/mumble.html b/pyweb/mumble/templates/mumble/mumble.html index 20db2b3..30b0596 100644 --- a/pyweb/mumble/templates/mumble/mumble.html +++ b/pyweb/mumble/templates/mumble/mumble.html @@ -41,7 +41,7 @@
{% if user.is_authenticated %}

{% trans "Server registration" %}

-
+ {% csrf_token %} {% if Registered %} {% trans "You are registered on this server" %}.
{% else %} @@ -93,7 +93,7 @@ {% endblocktrans %} {% endif %}

- + {% csrf_token %} {{ TextureForm }}
@@ -107,7 +107,7 @@ {% if CurrentUserIsAdmin %}

{% trans "Server administration" %}

- + {% csrf_token %} {{ AdminForm }}
@@ -164,7 +164,7 @@ {% if CurrentUserIsAdmin or user.is_staff %}
{% trans "Kick user" %} - + {% csrf_token %}
    diff --git a/pyweb/settings.py b/pyweb/settings.py index bf543b9..5a78ddf 100644 --- a/pyweb/settings.py +++ b/pyweb/settings.py @@ -209,7 +209,6 @@ MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', - 'django.middleware.csrf.CsrfResponseMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', ) diff --git a/pyweb/templates/registration/login.html b/pyweb/templates/registration/login.html index 250f25b..8fbea65 100644 --- a/pyweb/templates/registration/login.html +++ b/pyweb/templates/registration/login.html @@ -19,7 +19,7 @@

    Username or password don't exist or are not correct. Please try again.

    {% endif %} - +{% csrf_token %}
    {{ form.username.label_tag }}{{ form.username }}
    {{ form.password.label_tag }}{{ form.password }}