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
|
|
|
|
|
|
|
|
PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
BASE_DIR = os.path.dirname(PROJECT_DIR)
|
|
|
|
|
2017-09-14 11:44:58 +00:00
|
|
|
# Project custom settings
|
|
|
|
|
|
|
|
NEWS_ENTRIES_HOME_PAGE = 2
|
|
|
|
BLOG_ENTRIES_HOME_PAGE = 3
|
|
|
|
|
|
|
|
STREAMS_ON_HOME_PAGE = [
|
2017-09-15 07:51:59 +00:00
|
|
|
{ 'name': 'News', 'link': 'top-news', 'icon': 'glyphicon-eye-open' },
|
|
|
|
{ 'name': 'Events', 'link': 'top-events', 'icon': 'glyphicon-time' },
|
|
|
|
{ 'name': 'Jobs', 'link': 'top-jobs', 'icon': 'glyphicon-briefcase' },
|
2017-09-14 11:44:58 +00:00
|
|
|
]
|
|
|
|
|
2016-12-09 05:11:31 +00:00
|
|
|
# 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
|
|
|
|
2019-05-13 15:11:16 +00:00
|
|
|
'wagtail.contrib.routable_page',
|
|
|
|
'wagtail.contrib.sitemaps',
|
2017-07-03 11:35:36 +00:00
|
|
|
'wagtail.contrib.modeladmin',
|
2017-04-21 13:07:24 +00:00
|
|
|
'wagtail.contrib.settings',
|
2019-05-13 15:11:16 +00:00
|
|
|
'wagtail.contrib.forms',
|
|
|
|
'wagtail.contrib.redirects',
|
2019-08-12 13:56:27 +00:00
|
|
|
'wagtail.contrib.search_promotions',
|
2021-09-08 07:10:44 +00:00
|
|
|
"wagtail.contrib.legacy.richtext",
|
2019-09-11 21:45:37 +00:00
|
|
|
|
2019-05-13 15:11:16 +00:00
|
|
|
'wagtail.embeds',
|
|
|
|
'wagtail.sites',
|
|
|
|
'wagtail.users',
|
|
|
|
'wagtail.snippets',
|
|
|
|
'wagtail.documents',
|
|
|
|
'wagtail.images',
|
|
|
|
'wagtail.search',
|
|
|
|
'wagtail.admin',
|
|
|
|
'wagtail.core',
|
2016-12-09 05:11:31 +00:00
|
|
|
|
2017-07-03 14:42:27 +00:00
|
|
|
'wagtail.api.v2',
|
|
|
|
'rest_framework',
|
2018-11-12 20:24:43 +00:00
|
|
|
'crispy_forms', # required by rest_framework
|
2017-07-03 14:42:27 +00:00
|
|
|
|
2016-12-09 05:11:31 +00:00
|
|
|
'modelcluster',
|
|
|
|
'compressor',
|
|
|
|
'taggit',
|
2017-03-13 16:33:02 +00:00
|
|
|
'puput',
|
2017-04-05 21:50:38 +00:00
|
|
|
'anymail',
|
2017-07-03 14:23:20 +00:00
|
|
|
'feedler',
|
2019-08-09 13:44:50 +00:00
|
|
|
'colorful',
|
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',
|
2019-08-09 13:44:50 +00:00
|
|
|
'django_social_share'
|
2016-12-09 05:11:31 +00:00
|
|
|
]
|
|
|
|
|
2019-06-14 20:02:15 +00:00
|
|
|
MIDDLEWARE = [
|
2016-12-09 05:11:31 +00:00
|
|
|
'django.middleware.security.SecurityMiddleware',
|
2018-11-12 17:54:25 +00:00
|
|
|
'whitenoise.middleware.WhiteNoiseMiddleware',
|
|
|
|
|
2016-12-09 05:11:31 +00:00
|
|
|
'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',
|
|
|
|
|
2019-05-13 15:11:16 +00:00
|
|
|
'wagtail.contrib.redirects.middleware.RedirectMiddleware',
|
2016-12-09 05:11:31 +00:00
|
|
|
]
|
|
|
|
|
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 23:12:47 +00:00
|
|
|
'default': {
|
|
|
|
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
|
|
|
'NAME': 'publichealth',
|
|
|
|
}
|
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',
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
2017-07-06 13:51:05 +00:00
|
|
|
PASSWORD_REQUIRED_TEMPLATE = 'password.html'
|
2016-12-09 05:11:31 +00:00
|
|
|
|
|
|
|
# Internationalization
|
|
|
|
# https://docs.djangoproject.com/en/1.8/topics/i18n/
|
|
|
|
|
2017-09-04 21:03:01 +00:00
|
|
|
LANGUAGES = (
|
|
|
|
('de', u'Deutsch'),
|
|
|
|
('fr', u'Français'),
|
2018-05-16 13:08:59 +00:00
|
|
|
('en', u'English'),
|
2017-09-04 21:03:01 +00:00
|
|
|
)
|
2017-05-09 10:17:20 +00:00
|
|
|
LANGUAGE_CODE = 'de' # default language
|
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'),
|
|
|
|
]
|
|
|
|
|
2018-11-12 17:54:25 +00:00
|
|
|
# Whitenoise compression and caching support
|
|
|
|
# http://whitenoise.evans.io/en/stable/django.html
|
|
|
|
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
|
|
|
|
|
2016-12-09 05:11:31 +00:00
|
|
|
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'),
|
|
|
|
]
|
|
|
|
|
|
|
|
# Wagtail settings
|
|
|
|
|
|
|
|
WAGTAIL_SITE_NAME = "Public Health Schweiz"
|
2017-03-13 16:33:02 +00:00
|
|
|
|
2019-09-11 21:45:37 +00:00
|
|
|
WAGTAILADMIN_RICH_TEXT_EDITORS = {
|
|
|
|
'default': {
|
|
|
|
'WIDGET': 'wagtail.admin.rich_text.HalloRichTextArea'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-13 16:33:02 +00:00
|
|
|
# Puput settings
|
|
|
|
|
2017-03-27 22:43:55 +00:00
|
|
|
PUPUT_AS_PLUGIN = True
|