diff --git a/settings.py b/settings.py index 5a41239..ef24512 100644 --- a/settings.py +++ b/settings.py @@ -1,6 +1,7 @@ from localsettings import * #inital localsettings call so that urljoins work import os import urlparse +import django # Django settings for troggle project. DEBUG = True @@ -58,12 +59,17 @@ TEMPLATE_CONTEXT_PROCESSORS = ( "django.core.context_processors.auth", "core.con LOGIN_REDIRECT_URL = '/' +if django.VERSION[0] >=1 and django.VERSION[1] > 1: + csrfmiddleware = 'django.middleware.csrf.CsrfViewMiddleware' +else: + csrfmiddleware = 'django.contrib.csrf.middleware.CsrfMiddleware' + MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.redirects.middleware.RedirectFallbackMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', + csrfmiddleware, 'troggle.middleware.SmartAppendSlashMiddleware' )