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