Initial commit
[copyspeak.git] / src / copyspeak / settings / middleware.py
1 from . import INSTALLED_APPS
2
3
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',
9
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     # 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'
23 ) if x is not None)