lesson top links
[edumed.git] / edumed / settings.d / 40-middleware.py
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',
6
7     'django.middleware.common.CommonMiddleware',
8     'django.middleware.csrf.CsrfViewMiddleware',
9     'django.contrib.auth.middleware.AuthenticationMiddleware'
10             if "django.contrib.auth" in INSTALLED_APPS else None,
11     'django_cas.middleware.CASMiddleware'
12             if "django_cas" in INSTALLED_APPS else None,
13     'django.contrib.messages.middleware.MessageMiddleware'
14             if "django.contrib.messages" in INSTALLED_APPS else None,
15     'piwik.django.middleware.PiwikMiddleware'
16             if "piwik.django" in INSTALLED_APPS else None,
17     # Uncomment the next line for simple clickjacking protection:
18     # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
19     'pagination.middleware.PaginationMiddleware'
20             if "pagination" in INSTALLED_APPS else None,
21     'fnpdjango.middleware.SetRemoteAddrFromXRealIP'
22 ) if x is not None)