2016-12-09 05:11:31 +00:00
|
|
|
"""
|
2016-12-09 05:13:01 +00:00
|
|
|
Django settings for publichealth project.
|
2016-12-09 05:11:31 +00:00
|
|
|
|
|
|
|
Generated by 'django-admin startproject' using Django 1.8.2.
|
|
|
|
|
|
|
|
For more information on this file, see
|
|
|
|
https://docs.djangoproject.com/en/1.8/topics/settings/
|
|
|
|
|
|
|
|
For the full list of settings and their values, see
|
|
|
|
https://docs.djangoproject.com/en/1.8/ref/settings/
|
|
|
|
"""
|
|
|
|
|
2017-03-13 16:33:02 +00:00
|
|
|
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
|
|
|
|
|
2016-12-09 05:11:31 +00:00
|
|
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
|
|
|
import os
|
2017-03-27 22:43:55 +00:00
|
|
|
import dj_database_url
|
2016-12-09 05:11:31 +00:00
|
|
|
|
|
|
|
PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
BASE_DIR = os.path.dirname(PROJECT_DIR)
|
|
|
|
|
|
|
|
# Application definition
|
|
|
|
|
|
|
|
INSTALLED_APPS = [
|
2016-12-09 05:13:01 +00:00
|
|
|
'publichealth.home',
|
2017-03-07 21:36:33 +00:00
|
|
|
'publichealth.home.templatetags',
|
2016-12-09 05:13:01 +00:00
|
|
|
'publichealth.search',
|
2016-12-09 05:11:31 +00:00
|
|
|
|
|
|
|
'wagtail.contrib.wagtailsearchpromotions',
|
2017-03-07 22:37:55 +00:00
|
|
|
'wagtail.contrib.wagtailroutablepage',
|
2017-03-13 16:33:02 +00:00
|
|
|
'wagtail.contrib.wagtailsitemaps',
|
2016-12-09 05:11:31 +00:00
|
|
|
'wagtail.wagtailforms',
|
|
|
|
'wagtail.wagtailredirects',
|
|
|
|
'wagtail.wagtailembeds',
|
|
|
|
'wagtail.wagtailsites',
|
|
|
|
'wagtail.wagtailusers',
|
|
|
|
'wagtail.wagtailsnippets',
|
|
|
|
'wagtail.wagtaildocs',
|
|
|
|
'wagtail.wagtailimages',
|
|
|
|
'wagtail.wagtailsearch',
|
|
|
|
'wagtail.wagtailadmin',
|
|
|
|
'wagtail.wagtailcore',
|
|
|
|
|
|
|
|
'modelcluster',
|
|
|
|
'compressor',
|
|
|
|
'taggit',
|
2017-03-13 16:33:02 +00:00
|
|
|
'puput',
|
2016-12-09 05:11:31 +00:00
|
|
|
|
|
|
|
'django.contrib.admin',
|
|
|
|
'django.contrib.auth',
|
|
|
|
'django.contrib.contenttypes',
|
|
|
|
'django.contrib.sessions',
|
|
|
|
'django.contrib.messages',
|
|
|
|
'django.contrib.staticfiles',
|
|
|
|
]
|
|
|
|
|
|
|
|
MIDDLEWARE_CLASSES = [
|
|
|
|
'django.middleware.security.SecurityMiddleware',
|
|
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
|
|
'django.middleware.common.CommonMiddleware',
|
|
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
|
|
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
|
|
|
2016-12-09 05:54:14 +00:00
|
|
|
'django.middleware.locale.LocaleMiddleware',
|
|
|
|
|
2016-12-09 05:11:31 +00:00
|
|
|
'wagtail.wagtailcore.middleware.SiteMiddleware',
|
|
|
|
'wagtail.wagtailredirects.middleware.RedirectMiddleware',
|
|
|
|
]
|
|
|
|
|
2016-12-09 05:13:01 +00:00
|
|
|
ROOT_URLCONF = 'publichealth.urls'
|
2016-12-09 05:11:31 +00:00
|
|
|
|
|
|
|
TEMPLATES = [
|
|
|
|
{
|
|
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
|
|
'DIRS': [
|
|
|
|
os.path.join(PROJECT_DIR, 'templates'),
|
|
|
|
],
|
|
|
|
'APP_DIRS': True,
|
|
|
|
'OPTIONS': {
|
|
|
|
'context_processors': [
|
|
|
|
'django.template.context_processors.debug',
|
|
|
|
'django.template.context_processors.request',
|
|
|
|
'django.contrib.auth.context_processors.auth',
|
|
|
|
'django.contrib.messages.context_processors.messages',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
2016-12-09 05:13:01 +00:00
|
|
|
WSGI_APPLICATION = 'publichealth.wsgi.application'
|
2016-12-09 05:11:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Database
|
|
|
|
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
|
|
|
|
|
|
|
|
DATABASES = {
|
2017-03-27 22:43:55 +00:00
|
|
|
'default': dj_database_url.config()
|
2016-12-09 05:11:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# Password validation
|
|
|
|
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
|
|
|
|
|
|
|
|
AUTH_PASSWORD_VALIDATORS = [
|
|
|
|
{
|
|
|
|
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
# Internationalization
|
|
|
|
# https://docs.djangoproject.com/en/1.8/topics/i18n/
|
|
|
|
|
2016-12-09 05:54:14 +00:00
|
|
|
LANGUAGE_CODE = 'de-DE'
|
2016-12-09 05:11:31 +00:00
|
|
|
|
2016-12-09 05:54:14 +00:00
|
|
|
TIME_ZONE = 'Europe/Zurich'
|
2016-12-09 05:11:31 +00:00
|
|
|
|
|
|
|
USE_I18N = True
|
|
|
|
|
|
|
|
USE_L10N = True
|
|
|
|
|
|
|
|
USE_TZ = True
|
|
|
|
|
|
|
|
|
|
|
|
# Static files (CSS, JavaScript, Images)
|
|
|
|
# https://docs.djangoproject.com/en/1.8/howto/static-files/
|
|
|
|
|
|
|
|
STATICFILES_FINDERS = [
|
|
|
|
'django.contrib.staticfiles.finders.FileSystemFinder',
|
|
|
|
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
|
|
|
'compressor.finders.CompressorFinder',
|
|
|
|
]
|
|
|
|
|
|
|
|
STATICFILES_DIRS = [
|
|
|
|
os.path.join(PROJECT_DIR, 'static'),
|
|
|
|
]
|
|
|
|
|
|
|
|
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
|
|
|
|
STATIC_URL = '/static/'
|
|
|
|
|
|
|
|
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
|
|
|
MEDIA_URL = '/media/'
|
|
|
|
|
|
|
|
|
|
|
|
# Django compressor settings
|
|
|
|
# http://django-compressor.readthedocs.org/en/latest/settings/
|
|
|
|
|
|
|
|
COMPRESS_PRECOMPILERS = [
|
|
|
|
('text/x-scss', 'django_libsass.SassCompiler'),
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
# Use Redis as the cache backend for extra performance
|
|
|
|
|
|
|
|
CACHES = {
|
|
|
|
'default': {
|
|
|
|
'BACKEND': 'django_redis.cache.RedisCache',
|
|
|
|
'LOCATION': '127.0.0.1:6379',
|
2016-12-09 05:13:01 +00:00
|
|
|
'KEY_PREFIX': 'publichealth',
|
2016-12-09 05:11:31 +00:00
|
|
|
'OPTIONS': {
|
|
|
|
'CLIENT_CLASS': 'django_redis.client.DefaultClient',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# Use Elasticsearch as the search backend for extra performance and better search results
|
|
|
|
|
|
|
|
WAGTAILSEARCH_BACKENDS = {
|
|
|
|
'default': {
|
2017-01-11 12:52:27 +00:00
|
|
|
'BACKEND': 'wagtail.wagtailsearch.backends.db',
|
|
|
|
#'BACKEND': 'wagtail.wagtailsearch.backends.elasticsearch.ElasticSearch',
|
2016-12-09 05:13:01 +00:00
|
|
|
'INDEX': 'publichealth',
|
2016-12-09 05:11:31 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# Wagtail settings
|
|
|
|
|
|
|
|
WAGTAIL_SITE_NAME = "Public Health Schweiz"
|
2017-03-13 16:33:02 +00:00
|
|
|
|
|
|
|
# Puput settings
|
|
|
|
|
2017-03-27 22:43:55 +00:00
|
|
|
PUPUT_AS_PLUGIN = True
|