From: jordan Date: Tue, 7 Jun 2011 22:14:37 +0000 (+0000) Subject: removing CSRF backward compatiblity, the import in the settings file causes caching... X-Git-Tag: live~254 X-Git-Url: https://git.openstreetmap.org/osqa.git/commitdiff_plain/ff4ced0172977ed22c4debbc133c3767f4fb57ea removing CSRF backward compatiblity, the import in the settings file causes caching issues git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1059 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/settings.py b/settings.py index f1c6f6b..041f6ae 100644 --- a/settings.py +++ b/settings.py @@ -15,6 +15,8 @@ TEMPLATE_LOADERS = [ ] MIDDLEWARE_CLASSES = [ + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.middleware.csrf.CsrfResponseMiddleware', 'forum.middleware.django_cookies.CookiePreHandlerMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', @@ -26,19 +28,6 @@ MIDDLEWARE_CLASSES = [ 'django.middleware.transaction.TransactionMiddleware', 'forum.middleware.django_cookies.CookiePostHandlerMiddleware', ] -# Backwards compatibility. If we fail to import the CSRF middle-ware from the location -# where it is supposed to be, we add the old middle-ware classes to the classes list. -try: - from django.middleware.csrf import CsrfViewMiddleware - MIDDLEWARE_CLASSES = [ - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.middleware.csrf.CsrfResponseMiddleware', - ] + MIDDLEWARE_CLASSES -except ImportError: - MIDDLEWARE_CLASSES = [ - 'django.contrib.csrf.middleware.CsrfViewMiddleware', - 'django.contrib.csrf.middleware.CsrfResponseMiddleware', - ] + MIDDLEWARE_CLASSES TEMPLATE_CONTEXT_PROCESSORS = [ 'django.core.context_processors.request',