1 MIDDLEWARE_CLASSES = tuple(x for x in (
2 'django.contrib.sessions.middleware.SessionMiddleware'
3 if "django.contrib.sessions" in INSTALLED_APPS else None,
4 #'django.middleware.locale.LocaleMiddleware',
5 'fnpdjango.middleware.URLLocaleMiddleware',
7 'django.middleware.common.CommonMiddleware',
8 'django.middleware.csrf.CsrfViewMiddleware',
9 'honeypot.middleware.HoneypotMiddleware',
10 'django.contrib.auth.middleware.AuthenticationMiddleware'
11 if "django.contrib.auth" in INSTALLED_APPS else None,
12 'django_cas.middleware.CASMiddleware'
13 if "django_cas" in INSTALLED_APPS else None,
14 'django.contrib.messages.middleware.MessageMiddleware'
15 if "django.contrib.messages" in INSTALLED_APPS else None,
16 'piwik.django.middleware.PiwikMiddleware'
17 if "piwik.django" in INSTALLED_APPS else None,
18 # Uncomment the next line for simple clickjacking protection:
19 # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
20 'pagination.middleware.PaginationMiddleware'
21 if "pagination" in INSTALLED_APPS else None,
22 'fnpdjango.middleware.SetRemoteAddrFromXRealIP'