2015-11-02 20:44:18 +00:00
|
|
|
"""
|
|
|
|
Copyright 2015 ungleich.
|
|
|
|
"""
|
|
|
|
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
|
|
|
import os
|
2018-02-20 07:48:19 +00:00
|
|
|
import json
|
2016-03-05 19:57:41 +00:00
|
|
|
|
2017-04-24 22:07:50 +00:00
|
|
|
from django.utils.translation import ugettext_lazy as _
|
2015-11-02 20:44:18 +00:00
|
|
|
|
2017-04-24 22:25:05 +00:00
|
|
|
# dotenv
|
|
|
|
import dotenv
|
2017-08-06 16:39:45 +00:00
|
|
|
import logging
|
|
|
|
|
|
|
|
logger = logging.getLogger(__name__)
|
2017-04-24 22:25:05 +00:00
|
|
|
|
2017-06-29 14:34:40 +00:00
|
|
|
|
|
|
|
def gettext(s):
|
|
|
|
return s
|
2015-11-02 20:44:18 +00:00
|
|
|
|
2015-11-05 07:02:18 +00:00
|
|
|
|
2015-11-02 20:44:18 +00:00
|
|
|
def env(env_name):
|
|
|
|
return os.environ.get(env_name)
|
|
|
|
|
2016-03-05 19:57:41 +00:00
|
|
|
|
2017-07-04 18:46:42 +00:00
|
|
|
def bool_env(val):
|
|
|
|
"""Replaces string based environment values with Python booleans"""
|
|
|
|
return True if os.environ.get(val, False) == 'True' else False
|
2016-03-05 19:57:41 +00:00
|
|
|
|
2017-07-06 23:17:15 +00:00
|
|
|
|
2017-08-06 16:39:45 +00:00
|
|
|
def int_env(val, default_value=0):
|
|
|
|
"""Replaces string based environment values with Python integers
|
|
|
|
Return default_value if val is not set or cannot be parsed, otherwise
|
|
|
|
returns the python integer equal to the passed val
|
|
|
|
"""
|
|
|
|
return_value = default_value
|
|
|
|
try:
|
|
|
|
return_value = int(os.environ.get(val))
|
|
|
|
except Exception as e:
|
2017-08-23 19:50:32 +00:00
|
|
|
logger.error(
|
|
|
|
("Encountered exception trying to get env value for {}\nException "
|
|
|
|
"details: {}").format(
|
|
|
|
val, str(e)))
|
2017-08-06 16:39:45 +00:00
|
|
|
|
|
|
|
return return_value
|
|
|
|
|
|
|
|
|
2015-11-02 20:44:18 +00:00
|
|
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
|
|
|
|
PROJECT_DIR = os.path.abspath(
|
|
|
|
os.path.join(os.path.dirname(__file__), "../.."),
|
|
|
|
)
|
|
|
|
|
|
|
|
# load .env file
|
|
|
|
dotenv.read_dotenv("{0}/.env".format(PROJECT_DIR))
|
|
|
|
|
2018-02-15 09:58:06 +00:00
|
|
|
from multisite import SiteID
|
|
|
|
SITE_ID = SiteID(default=1)
|
2015-11-02 20:44:18 +00:00
|
|
|
|
|
|
|
APP_ROOT_ENDPOINT = "/"
|
2016-05-07 21:05:46 +00:00
|
|
|
APPEND_SLASH = True
|
2015-11-02 20:44:18 +00:00
|
|
|
|
|
|
|
LOGIN_URL = None
|
|
|
|
LOGOUT_URL = None
|
|
|
|
LOGIN_REDIRECT_URL = None
|
|
|
|
|
2017-12-30 23:58:37 +00:00
|
|
|
EMAIL_HOST = env("EMAIL_HOST")
|
|
|
|
if not EMAIL_HOST:
|
|
|
|
EMAIL_HOST = "localhost"
|
|
|
|
EMAIL_PORT = int_env("EMAIL_PORT", 25)
|
|
|
|
EMAIL_USE_TLS = bool_env("EMAIL_USE_TLS")
|
|
|
|
|
2015-11-02 20:44:18 +00:00
|
|
|
SECRET_KEY = env('DJANGO_SECRET_KEY')
|
|
|
|
|
|
|
|
# Application definition
|
|
|
|
|
|
|
|
INSTALLED_APPS = (
|
2016-05-07 21:05:46 +00:00
|
|
|
# 1st migrate
|
2016-03-07 16:49:02 +00:00
|
|
|
'membership',
|
2018-02-13 01:38:23 +00:00
|
|
|
'djangocms_admin_style',
|
2015-11-02 20:44:18 +00:00
|
|
|
'django.contrib.admin',
|
|
|
|
'django.contrib.auth',
|
|
|
|
'django.contrib.contenttypes',
|
2018-03-27 14:08:09 +00:00
|
|
|
'django.contrib.humanize',
|
2015-11-02 20:44:18 +00:00
|
|
|
'django.contrib.sessions',
|
|
|
|
'django.contrib.messages',
|
|
|
|
'django.contrib.staticfiles',
|
|
|
|
'django.contrib.sites',
|
2018-02-15 16:37:51 +00:00
|
|
|
'multisite',
|
|
|
|
'djangocms_multisite',
|
2015-11-02 20:44:18 +00:00
|
|
|
'easy_thumbnails',
|
2016-04-10 21:12:43 +00:00
|
|
|
'utils',
|
2016-05-29 18:37:43 +00:00
|
|
|
'stored_messages',
|
2016-03-15 23:26:49 +00:00
|
|
|
'mptt',
|
2015-11-02 20:44:18 +00:00
|
|
|
'parler',
|
2016-06-26 19:50:48 +00:00
|
|
|
'guardian',
|
2015-11-02 20:44:18 +00:00
|
|
|
'taggit',
|
|
|
|
'taggit_autosuggest',
|
2016-03-25 18:18:07 +00:00
|
|
|
# 'django_select2',
|
2015-11-02 20:44:18 +00:00
|
|
|
'meta',
|
|
|
|
'meta_mixin',
|
|
|
|
'bootstrap3',
|
|
|
|
'compressor',
|
2016-03-07 16:49:02 +00:00
|
|
|
'filer',
|
2016-03-07 17:39:24 +00:00
|
|
|
'djangocms_blog',
|
2016-03-15 23:26:49 +00:00
|
|
|
'cms', # django CMS itself
|
2016-03-25 18:18:07 +00:00
|
|
|
'aldryn_apphooks_config',
|
|
|
|
'aldryn_boilerplates',
|
|
|
|
'aldryn_categories',
|
|
|
|
'aldryn_common',
|
|
|
|
'aldryn_newsblog',
|
|
|
|
'aldryn_people',
|
|
|
|
'aldryn_reversion',
|
|
|
|
'aldryn_translation_tools',
|
2015-11-02 20:44:18 +00:00
|
|
|
'treebeard', # utilities for implementing a tree
|
|
|
|
'sekizai', # for javascript and css management
|
2016-03-15 23:26:49 +00:00
|
|
|
'menus', # helper for model independent hierarchical website navigation
|
|
|
|
'cmsplugin_filer_image',
|
2016-03-19 20:28:58 +00:00
|
|
|
|
2016-05-07 21:05:46 +00:00
|
|
|
# 2nd migrate
|
2015-11-05 07:02:18 +00:00
|
|
|
# django-cms plugins
|
2016-05-07 21:05:46 +00:00
|
|
|
'djangocms_file',
|
|
|
|
'djangocms_picture',
|
|
|
|
'djangocms_video',
|
2016-05-20 15:00:06 +00:00
|
|
|
# 'djangocms_flash',
|
|
|
|
# 'djangocms_googlemap',
|
|
|
|
# 'djangocms_inherit',
|
|
|
|
# 'djangocms_link',
|
|
|
|
# 'djangocms_teaser',
|
2016-05-07 21:05:46 +00:00
|
|
|
'djangocms_page_meta',
|
|
|
|
'djangocms_text_ckeditor',
|
|
|
|
'cmsplugin_filer_file',
|
|
|
|
'cmsplugin_filer_folder',
|
|
|
|
'cmsplugin_filer_link',
|
2016-05-20 15:00:06 +00:00
|
|
|
# 'cmsplugin_filer_teaser',
|
2016-05-07 21:05:46 +00:00
|
|
|
'cmsplugin_filer_video',
|
2016-03-22 00:21:50 +00:00
|
|
|
#
|
2016-05-07 21:05:46 +00:00
|
|
|
# blog
|
2015-11-02 20:44:18 +00:00
|
|
|
# versioning
|
|
|
|
'reversion',
|
|
|
|
# ungleich
|
|
|
|
'ungleich',
|
2016-05-20 15:00:06 +00:00
|
|
|
'ungleich_page',
|
2015-11-02 20:44:18 +00:00
|
|
|
'hosting',
|
|
|
|
'digitalglarus',
|
2016-07-19 06:07:49 +00:00
|
|
|
'nosystemd',
|
2016-12-20 23:05:20 +00:00
|
|
|
'datacenterlight',
|
2018-01-08 02:06:30 +00:00
|
|
|
# 'datacenterlight.templatetags',
|
2017-04-23 21:31:05 +00:00
|
|
|
'alplora',
|
2017-05-09 14:33:56 +00:00
|
|
|
'rest_framework',
|
2017-08-06 14:32:27 +00:00
|
|
|
'opennebula_api',
|
|
|
|
'django_celery_results',
|
2015-11-02 20:44:18 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
MIDDLEWARE_CLASSES = (
|
|
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
2017-06-30 05:44:39 +00:00
|
|
|
'utils.middleware.MultipleProxyMiddleware',
|
2015-11-02 20:44:18 +00:00
|
|
|
'django.middleware.common.CommonMiddleware',
|
|
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
|
|
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
|
|
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
|
|
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
|
|
'django.middleware.locale.LocaleMiddleware',
|
|
|
|
# django-cms middlewares
|
|
|
|
'cms.middleware.user.CurrentUserMiddleware',
|
|
|
|
'cms.middleware.page.CurrentPageMiddleware',
|
|
|
|
'cms.middleware.toolbar.ToolbarMiddleware',
|
|
|
|
'cms.middleware.language.LanguageCookieMiddleware',
|
2018-02-15 16:37:51 +00:00
|
|
|
'multisite.middleware.DynamicSiteMiddleware',
|
|
|
|
'djangocms_multisite.middleware.CMSMultiSiteMiddleware',
|
2015-11-02 20:44:18 +00:00
|
|
|
)
|
|
|
|
|
2017-10-01 18:14:46 +00:00
|
|
|
CSRF_FAILURE_VIEW = 'hosting.views.forbidden_view'
|
|
|
|
|
2015-11-02 20:44:18 +00:00
|
|
|
ROOT_URLCONF = 'dynamicweb.urls'
|
|
|
|
|
|
|
|
TEMPLATES = [
|
|
|
|
{
|
|
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
2016-05-07 21:05:46 +00:00
|
|
|
'DIRS': [os.path.join(PROJECT_DIR, 'cms_templates/'),
|
|
|
|
os.path.join(PROJECT_DIR, 'cms_templates/djangocms_blog/'),
|
|
|
|
os.path.join(PROJECT_DIR, 'membership'),
|
2016-05-25 06:23:32 +00:00
|
|
|
os.path.join(PROJECT_DIR, 'hosting/templates/'),
|
2016-07-19 06:07:49 +00:00
|
|
|
os.path.join(PROJECT_DIR, 'nosystemd/templates/'),
|
2017-08-23 19:50:32 +00:00
|
|
|
os.path.join(PROJECT_DIR,
|
|
|
|
'ungleich/templates/djangocms_blog/'),
|
2017-09-15 11:09:46 +00:00
|
|
|
os.path.join(PROJECT_DIR,
|
|
|
|
'ungleich/templates/cms/ungleichch'),
|
2016-07-08 04:35:50 +00:00
|
|
|
os.path.join(PROJECT_DIR, 'ungleich/templates/ungleich'),
|
2017-08-23 19:50:32 +00:00
|
|
|
os.path.join(PROJECT_DIR,
|
|
|
|
'ungleich_page/templates/ungleich_page'),
|
2017-07-09 13:51:30 +00:00
|
|
|
os.path.join(PROJECT_DIR, 'templates/analytics'),
|
2016-05-07 21:05:46 +00:00
|
|
|
],
|
2015-11-02 20:44:18 +00:00
|
|
|
'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-03-05 19:57:41 +00:00
|
|
|
"django.core.context_processors.media",
|
|
|
|
"django.core.context_processors.static",
|
|
|
|
"django.core.context_processors.tz",
|
|
|
|
"django.contrib.messages.context_processors.messages",
|
|
|
|
'sekizai.context_processors.sekizai',
|
|
|
|
'cms.context_processors.cms_settings',
|
2017-06-29 22:23:35 +00:00
|
|
|
'utils.context_processor.google_analytics',
|
2015-11-02 20:44:18 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
WSGI_APPLICATION = 'dynamicweb.wsgi.application'
|
|
|
|
|
2016-04-01 10:37:01 +00:00
|
|
|
CMS_TEMPLATES = (
|
|
|
|
('base_glarus.html', gettext('default')),
|
|
|
|
('one_column.html', gettext('2 Column')),
|
|
|
|
('two_columns.html', gettext('3 Column')),
|
|
|
|
('about.html', gettext('DG.About')),
|
|
|
|
('contact.html', gettext('DG.Contact')),
|
2016-04-09 06:51:20 +00:00
|
|
|
('home_digitalglarus.html', gettext('DG.Home')),
|
2016-04-01 10:37:01 +00:00
|
|
|
('letscowork.html', gettext('DG.CoWork')),
|
2016-04-03 09:46:25 +00:00
|
|
|
# ('detail.html', gettext('DG.Detail')),
|
|
|
|
('one_column.html', gettext('DG.OneColumn')),
|
2016-05-07 21:05:46 +00:00
|
|
|
# ungleich
|
2016-04-03 09:46:25 +00:00
|
|
|
('blog_ungleich.html', gettext('Blog')),
|
|
|
|
('page.html', gettext('Page')),
|
2017-08-19 01:11:29 +00:00
|
|
|
# dcl
|
2018-02-27 22:39:19 +00:00
|
|
|
('datacenterlight/cms/base.html', gettext('Data Center Light')),
|
2017-10-17 07:06:45 +00:00
|
|
|
('ungleich_page/glasfaser_cms_page.html', gettext('Glasfaser')),
|
2017-11-17 15:32:40 +00:00
|
|
|
('ungleich_page/ungleich_cms_page.html', gettext('ungleich')),
|
2016-04-01 10:37:01 +00:00
|
|
|
)
|
2015-11-02 20:44:18 +00:00
|
|
|
|
|
|
|
DATABASES = {
|
|
|
|
'default': {
|
|
|
|
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
2017-06-29 14:34:40 +00:00
|
|
|
'NAME': 'app',
|
2015-11-02 20:44:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-26 19:50:48 +00:00
|
|
|
AUTHENTICATION_BACKENDS = (
|
|
|
|
'guardian.backends.ObjectPermissionBackend',
|
2016-07-11 03:08:51 +00:00
|
|
|
'django.contrib.auth.backends.ModelBackend',
|
2016-06-26 19:50:48 +00:00
|
|
|
)
|
2016-04-07 05:26:50 +00:00
|
|
|
|
2015-11-02 20:44:18 +00:00
|
|
|
# Internationalization
|
|
|
|
# https://docs.djangoproject.com/en/1.7/topics/i18n/
|
|
|
|
|
|
|
|
TIME_ZONE = 'UTC'
|
|
|
|
|
|
|
|
USE_I18N = True
|
|
|
|
|
|
|
|
USE_L10N = True
|
|
|
|
|
|
|
|
USE_TZ = True
|
|
|
|
|
2018-03-07 13:52:13 +00:00
|
|
|
FORMAT_MODULE_PATH = [
|
|
|
|
'dynamicweb.formats'
|
|
|
|
]
|
|
|
|
|
2015-11-02 20:44:18 +00:00
|
|
|
LANGUAGES = (
|
|
|
|
('en-us', _('English')),
|
|
|
|
('de', _('Deutsch')),
|
|
|
|
)
|
|
|
|
|
|
|
|
LANGUAGE_CODE = 'en-us'
|
|
|
|
|
2018-05-06 23:52:05 +00:00
|
|
|
LOCALE_PATHS = [
|
|
|
|
os.path.join(PROJECT_DIR, 'digitalglarus/locale'),
|
|
|
|
]
|
|
|
|
|
2015-11-02 20:44:18 +00:00
|
|
|
CMS_PLACEHOLDER_CONF = {
|
|
|
|
'logo_image': {
|
|
|
|
'name': 'Logo Image',
|
|
|
|
'plugins': ['FilerImagePlugin'],
|
|
|
|
'limits': {
|
|
|
|
'global': 1,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'page-title': {
|
|
|
|
'name': 'Page Title',
|
|
|
|
'plugins': ['TextPlugin'],
|
|
|
|
'default_plugins': [
|
|
|
|
{
|
|
|
|
'plugin_type': 'TextPlugin',
|
|
|
|
'values': {
|
|
|
|
'body': 'Page Title...'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
'limits': {
|
|
|
|
'global': 1,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'page-subtitle': {
|
|
|
|
'name': 'Page Subtitle',
|
|
|
|
'inherit': 'page-title',
|
|
|
|
'default_plugins': [
|
|
|
|
{
|
|
|
|
'plugin_type': 'TextPlugin',
|
|
|
|
'values': {
|
|
|
|
'body': 'Page subtitle...'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
},
|
|
|
|
'footer_copyright': {
|
|
|
|
'name': 'Copyright',
|
|
|
|
'inherit': 'page-title',
|
|
|
|
'default_plugins': [
|
|
|
|
{
|
|
|
|
'plugin_type': 'TextPlugin',
|
|
|
|
'values': {
|
|
|
|
'body': 'Copyright...'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
},
|
|
|
|
'content': {
|
2015-11-05 07:02:18 +00:00
|
|
|
'name': _('Content'),
|
|
|
|
'default_plugins': [
|
2015-11-02 20:44:18 +00:00
|
|
|
{
|
2015-11-05 07:02:18 +00:00
|
|
|
'plugin_type': 'TextPlugin',
|
|
|
|
'values': {'body': '<p></p>'},
|
2015-11-02 20:44:18 +00:00
|
|
|
},
|
|
|
|
]
|
|
|
|
},
|
|
|
|
'post_content': {
|
2015-11-05 07:02:18 +00:00
|
|
|
'name': _('Content'),
|
|
|
|
'default_plugins': [
|
2015-11-02 20:44:18 +00:00
|
|
|
{
|
2015-11-05 07:02:18 +00:00
|
|
|
'plugin_type': 'TextPlugin',
|
|
|
|
'values': {'body': '<p></p>'},
|
2015-11-02 20:44:18 +00:00
|
|
|
},
|
|
|
|
]
|
|
|
|
},
|
2018-02-27 22:39:19 +00:00
|
|
|
'datacenterlight_navbar': {
|
|
|
|
'name': _('Datacenterlight Navbar'),
|
|
|
|
'plugins': ['DCLNavbarPlugin'],
|
|
|
|
'default_plugins': [
|
|
|
|
{
|
|
|
|
'plugin_type': 'DCLNavbarPlugin',
|
|
|
|
'values': {},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
},
|
|
|
|
'datacenterlight_footer': {
|
|
|
|
'name': _('Datacenterlight Footer'),
|
|
|
|
'plugins': ['DCLFooterPlugin'],
|
|
|
|
'default_plugins': [
|
|
|
|
{
|
|
|
|
'plugin_type': 'DCLFooterPlugin',
|
|
|
|
'values': {},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
},
|
2018-04-25 09:22:25 +00:00
|
|
|
'datacenterlight_calculator': {
|
|
|
|
'name': _('Datacenterlight Calculator'),
|
|
|
|
'plugins': ['DCLCalculatorPlugin'],
|
|
|
|
'default_plugins': [
|
|
|
|
{
|
|
|
|
'plugin_type': 'DCLCalculatorPlugin',
|
|
|
|
'values': {
|
|
|
|
'pricing_id': 1
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
},
|
2015-11-02 20:44:18 +00:00
|
|
|
}
|
|
|
|
|
2018-03-07 13:52:13 +00:00
|
|
|
CMS_PERMISSION = True
|
2018-02-13 01:40:29 +00:00
|
|
|
|
2015-11-02 20:44:18 +00:00
|
|
|
CACHES = {
|
|
|
|
'default': {
|
|
|
|
'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
|
|
|
|
'LOCATION': '127.0.0.1:11211',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-20 15:00:06 +00:00
|
|
|
if LOGIN_URL is None:
|
|
|
|
LOGIN_URL = APP_ROOT_ENDPOINT + 'login/'
|
|
|
|
if LOGOUT_URL is None:
|
|
|
|
LOGOUT_URL = APP_ROOT_ENDPOINT + 'logout/'
|
|
|
|
if LOGIN_REDIRECT_URL is None:
|
|
|
|
LOGIN_REDIRECT_URL = APP_ROOT_ENDPOINT
|
2015-11-02 20:44:18 +00:00
|
|
|
|
|
|
|
# Static files (CSS, JavaScript, Images)
|
|
|
|
# https://docs.djangoproject.com/en/1.7/howto/static-files/
|
|
|
|
|
|
|
|
STATIC_URL = '/static/'
|
|
|
|
|
2015-11-02 21:58:52 +00:00
|
|
|
STATIC_ROOT = os.path.join(PROJECT_DIR, 'static')
|
2015-11-02 20:44:18 +00:00
|
|
|
|
2015-11-02 21:58:52 +00:00
|
|
|
MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media')
|
2015-11-02 20:44:18 +00:00
|
|
|
MEDIA_URL = APP_ROOT_ENDPOINT + 'media/'
|
|
|
|
FILE_UPLOAD_PERMISSIONS = 0o644
|
|
|
|
|
|
|
|
MIGRATION_MODULES = {
|
|
|
|
'cms': 'cms.migrations',
|
2016-05-20 15:00:06 +00:00
|
|
|
# 'filer': 'filer.migrations_django',
|
2016-03-07 17:39:24 +00:00
|
|
|
# 'menus': 'menus.migrations_django',
|
2015-11-02 20:44:18 +00:00
|
|
|
'djangocms_flash': 'djangocms_flash.migrations_django',
|
|
|
|
'djangocms_googlemap': 'djangocms_googlemap.migrations_django',
|
|
|
|
'djangocms_inherit': 'djangocms_inherit.migrations_django',
|
|
|
|
'djangocms_link': 'djangocms_link.migrations_django',
|
|
|
|
'djangocms_teaser': 'djangocms_teaser.migrations_django',
|
|
|
|
'djangocms_column': 'djangocms_column.migrations_django',
|
|
|
|
'djangocms_style': 'djangocms_style.migrations_django',
|
|
|
|
'cmsplugin_filer_image': 'cmsplugin_filer_image.migrations_django',
|
|
|
|
'cmsplugin_filer_file': 'cmsplugin_filer_file.migrations_django',
|
|
|
|
'cmsplugin_filer_folder': 'cmsplugin_filer_folder.migrations_django',
|
|
|
|
'cmsplugin_filer_link': 'cmsplugin_filer_link.migrations_django',
|
|
|
|
'cmsplugin_filer_teaser': 'cmsplugin_filer_teaser.migrations_django',
|
|
|
|
'cmsplugin_filer_utils': 'cmsplugin_filer_utils.migrations_django',
|
|
|
|
'cmsplugin_filer_video': 'cmsplugin_filer_video.migrations_django',
|
|
|
|
'djangocms_text_ckeditor': 'djangocms_text_ckeditor.migrations',
|
|
|
|
}
|
|
|
|
|
|
|
|
STATICFILES_FINDERS = (
|
|
|
|
'django.contrib.staticfiles.finders.FileSystemFinder',
|
|
|
|
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
|
|
|
'compressor.finders.CompressorFinder',
|
|
|
|
)
|
|
|
|
|
2016-05-07 21:05:46 +00:00
|
|
|
# COMPRESS_PRECOMPILERS = (
|
2016-03-19 20:28:58 +00:00
|
|
|
# ('text/less', 'lesscpy {infile}'),
|
2016-05-07 21:05:46 +00:00
|
|
|
# )
|
2015-11-02 20:44:18 +00:00
|
|
|
|
|
|
|
THUMBNAIL_PROCESSORS = (
|
|
|
|
'easy_thumbnails.processors.colorspace',
|
|
|
|
'easy_thumbnails.processors.autocrop',
|
|
|
|
'filer.thumbnail_processors.scale_and_crop_with_subject_location',
|
|
|
|
'easy_thumbnails.processors.filters',
|
|
|
|
)
|
|
|
|
|
|
|
|
# django-cms-text-ckeditor
|
2015-11-05 07:02:18 +00:00
|
|
|
TEXT_SAVE_IMAGE_FUNCTION = (
|
|
|
|
'cmsplugin_filer_image.integrations.ckeditor.create_image_plugin'
|
|
|
|
)
|
2015-11-02 20:44:18 +00:00
|
|
|
TEXT_ADDITIONAL_TAGS = ('iframe',)
|
|
|
|
TEXT_ADDITIONAL_ATTRIBUTES = ('scrolling', 'allowfullscreen', 'frameborder')
|
|
|
|
USE_X_FORWARDED_HOST = True
|
|
|
|
|
|
|
|
# Django Bootstrap - Settings
|
|
|
|
# Added Configuration for bootstrap static files to load over https.
|
|
|
|
BOOTSTRAP3 = {
|
|
|
|
|
|
|
|
# The URL to the jQuery JavaScript file
|
|
|
|
'jquery_url': '//code.jquery.com/jquery.min.js',
|
|
|
|
|
|
|
|
# The Bootstrap base URL
|
|
|
|
'base_url': '//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/',
|
|
|
|
|
2015-11-05 07:02:18 +00:00
|
|
|
# The complete URL to the Bootstrap CSS file
|
|
|
|
# (None means derive it from base_url)
|
2015-11-02 20:44:18 +00:00
|
|
|
'css_url': None,
|
|
|
|
|
|
|
|
# The complete URL to the Bootstrap CSS file (None means no theme)
|
|
|
|
'theme_url': None,
|
|
|
|
|
2015-11-05 07:02:18 +00:00
|
|
|
# The complete URL to the Bootstrap JavaScript file
|
|
|
|
# (None means derive it from base_url)
|
2015-11-02 20:44:18 +00:00
|
|
|
'javascript_url': None,
|
|
|
|
|
2015-11-05 07:02:18 +00:00
|
|
|
# Put JavaScript in the HEAD section of the HTML document
|
|
|
|
# (only relevant if you use bootstrap3.html)
|
2015-11-02 20:44:18 +00:00
|
|
|
'javascript_in_head': False,
|
|
|
|
|
2015-11-05 07:02:18 +00:00
|
|
|
# Include jQuery with Bootstrap JavaScript
|
|
|
|
# (affects django-bootstrap3 template tags)
|
2015-11-02 20:44:18 +00:00
|
|
|
'include_jquery': False,
|
|
|
|
|
|
|
|
# Label class to use in horizontal forms
|
|
|
|
'horizontal_label_class': 'col-md-3',
|
|
|
|
|
|
|
|
# Field class to use in horizontal forms
|
|
|
|
'horizontal_field_class': 'col-md-9',
|
|
|
|
|
|
|
|
# Set HTML required attribute on required fields
|
|
|
|
'set_required': True,
|
|
|
|
|
|
|
|
# Set HTML disabled attribute on disabled fields
|
|
|
|
'set_disabled': False,
|
|
|
|
|
|
|
|
# Set placeholder attributes to label if no placeholder is provided
|
|
|
|
'set_placeholder': True,
|
|
|
|
|
|
|
|
# Class to indicate required (better to set this in your Django form)
|
|
|
|
'required_css_class': '',
|
|
|
|
|
|
|
|
# Class to indicate error (better to set this in your Django form)
|
|
|
|
'error_css_class': 'has-error',
|
|
|
|
|
2015-11-05 07:02:18 +00:00
|
|
|
# Class to indicate success, meaning the field has valid input
|
|
|
|
# (better to set this in your Django form)
|
2015-11-02 20:44:18 +00:00
|
|
|
'success_css_class': 'has-success',
|
|
|
|
|
2015-11-05 07:02:18 +00:00
|
|
|
# Renderers (only set these if you have studied the source and understand
|
|
|
|
# the inner workings)
|
|
|
|
'formset_renderers': {
|
2015-11-02 20:44:18 +00:00
|
|
|
'default': 'bootstrap3.renderers.FormsetRenderer',
|
|
|
|
},
|
|
|
|
'form_renderers': {
|
|
|
|
'default': 'bootstrap3.renderers.FormRenderer',
|
|
|
|
},
|
|
|
|
'field_renderers': {
|
|
|
|
'default': 'bootstrap3.renderers.FieldRenderer',
|
|
|
|
'inline': 'bootstrap3.renderers.InlineFieldRenderer',
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
# djangocms_blog config
|
|
|
|
|
|
|
|
BLOG_ENABLE_COMMENTS = False
|
|
|
|
BLOG_USE_PLACEHOLDER = True
|
2015-11-05 07:02:18 +00:00
|
|
|
BLOG_IMAGE_THUMBNAIL_SIZE = {'size': '120x120', 'crop': True, 'upscale': False}
|
|
|
|
BLOG_IMAGE_FULL_SIZE = {'size': '640x120', 'crop': True, 'upscale': False}
|
2015-11-02 20:44:18 +00:00
|
|
|
BLOG_PAGINATION = 4
|
|
|
|
BLOG_LATEST_POSTS = BLOG_PAGINATION
|
|
|
|
BLOG_POSTS_LIST_TRUNCWORDS_COUNT = 100
|
|
|
|
BLOG_MULTISITE = True
|
|
|
|
BLOG_AUTHOR_DEFAULT = True
|
|
|
|
|
2015-11-05 07:02:18 +00:00
|
|
|
# django-meta
|
2015-11-02 20:44:18 +00:00
|
|
|
META_SITE_PROTOCOL = "https"
|
|
|
|
META_SITE_DOMAIN = "ungleich.ch"
|
|
|
|
META_SITE_TYPE = "website"
|
|
|
|
META_SITE_NAME = "ungleich"
|
2015-11-05 07:02:18 +00:00
|
|
|
META_INCLUDE_KEYWORDS = ["ungleich", "hosting", "switzerland",
|
|
|
|
"Schweiz", "Swiss", "cdist"]
|
2015-11-02 20:44:18 +00:00
|
|
|
META_USE_SITES = True
|
2015-11-05 07:02:18 +00:00
|
|
|
|
2018-04-13 12:14:00 +00:00
|
|
|
PARLER_LANGUAGES = {SITE_ID: ({'code': 'en-us'}, {'code': 'de'},)}
|
2016-03-07 17:39:24 +00:00
|
|
|
AUTH_USER_MODEL = 'membership.CustomUser'
|
2016-03-11 18:42:45 +00:00
|
|
|
|
|
|
|
# PAYMENT
|
|
|
|
|
|
|
|
STRIPE_DESCRIPTION_ON_PAYMENT = "Payment for ungleich GmbH services"
|
|
|
|
|
|
|
|
# EMAIL MESSAGES
|
2017-10-16 18:53:51 +00:00
|
|
|
REGISTRATION_MESSAGE = {
|
|
|
|
'subject': "Digital Glarus registration",
|
|
|
|
'message': 'Thank You for registering for account on Digital Glarus.'
|
|
|
|
}
|
2016-05-07 21:05:46 +00:00
|
|
|
STRIPE_API_PRIVATE_KEY = env('STRIPE_API_PRIVATE_KEY')
|
|
|
|
STRIPE_API_PUBLIC_KEY = env('STRIPE_API_PUBLIC_KEY')
|
2017-08-23 18:12:50 +00:00
|
|
|
STRIPE_API_PRIVATE_KEY_TEST = env('STRIPE_API_PRIVATE_KEY_TEST')
|
2016-03-15 23:26:49 +00:00
|
|
|
|
2016-07-11 03:42:06 +00:00
|
|
|
ANONYMOUS_USER_NAME = 'anonymous@ungleich.ch'
|
2017-04-24 16:51:11 +00:00
|
|
|
GUARDIAN_GET_INIT_ANONYMOUS_USER = 'membership.models.get_anonymous_user_instance'
|
|
|
|
|
2018-02-20 05:25:02 +00:00
|
|
|
UNGLEICH_SITE_CONFIGS = env('UNGLEICH_SITE_CONFIGS')
|
|
|
|
|
|
|
|
MULTISITE_CMS_URLS = {}
|
|
|
|
if UNGLEICH_SITE_CONFIGS == "":
|
|
|
|
raise Exception("Please define UNGLEICH_SITE_CONFIGS in your .env")
|
|
|
|
else:
|
2018-02-20 07:48:19 +00:00
|
|
|
try:
|
2018-03-07 13:52:13 +00:00
|
|
|
configs_dict = json.loads(UNGLEICH_SITE_CONFIGS)
|
2018-02-20 07:48:19 +00:00
|
|
|
except ValueError as verr:
|
2018-02-22 06:07:26 +00:00
|
|
|
raise Exception("UNGLEICH_SITE_CONFIGS is not a valid JSON: {}".format(
|
|
|
|
str(verr)
|
|
|
|
))
|
2018-02-20 07:48:19 +00:00
|
|
|
else:
|
|
|
|
MULTISITE_CMS_URLS = {
|
2018-03-07 13:52:13 +00:00
|
|
|
k: v['MULTISITE_CMS_URL'] for (k, v) in configs_dict.items()
|
2018-02-20 07:48:19 +00:00
|
|
|
}
|
2018-02-20 05:25:02 +00:00
|
|
|
|
2018-02-15 16:37:51 +00:00
|
|
|
MULTISITE_CMS_ALIASES = {
|
|
|
|
}
|
2018-02-20 05:25:02 +00:00
|
|
|
MULTISITE_CMS_FALLBACK = env('MULTISITE_CMS_FALLBACK')
|
|
|
|
if MULTISITE_CMS_FALLBACK == '':
|
|
|
|
MULTISITE_CMS_FALLBACK = 'datacenterlight.ch'
|
2018-02-17 15:52:54 +00:00
|
|
|
MULTISITE_FALLBACK = 'django.views.generic.base.RedirectView'
|
2018-02-20 05:25:02 +00:00
|
|
|
MULTISITE_FALLBACK_KWARGS = {
|
|
|
|
'url': 'https://{}/'.format(MULTISITE_CMS_FALLBACK), 'permanent': False
|
|
|
|
}
|
2018-02-17 15:52:54 +00:00
|
|
|
|
2018-02-17 16:01:07 +00:00
|
|
|
FILER_ENABLE_PERMISSIONS = True
|
|
|
|
|
2018-02-15 16:37:51 +00:00
|
|
|
|
2017-04-24 16:51:11 +00:00
|
|
|
#############################################
|
|
|
|
# configurations for opennebula-integration #
|
|
|
|
#############################################
|
|
|
|
|
|
|
|
# The oneadmin user name of the OpenNebula infrastructure
|
2017-04-26 17:56:35 +00:00
|
|
|
OPENNEBULA_USERNAME = env('OPENNEBULA_USERNAME')
|
2017-04-24 16:51:11 +00:00
|
|
|
|
|
|
|
# The oneadmin password of the OpenNebula infrastructure
|
|
|
|
# The default credentials of the Sandbox OpenNebula VM is
|
|
|
|
# oneadmin:opennebula
|
2017-04-26 04:57:15 +00:00
|
|
|
OPENNEBULA_PASSWORD = env('OPENNEBULA_PASSWORD')
|
2017-04-24 16:51:11 +00:00
|
|
|
|
|
|
|
# The protocol is generally http or https
|
2017-04-26 04:57:15 +00:00
|
|
|
OPENNEBULA_PROTOCOL = env('OPENNEBULA_PROTOCOL')
|
2017-04-24 16:51:11 +00:00
|
|
|
|
|
|
|
# The ip address or the domain name of the opennebula infrastructure
|
2017-04-26 04:57:15 +00:00
|
|
|
OPENNEBULA_DOMAIN = env('OPENNEBULA_DOMAIN')
|
2017-04-24 16:51:11 +00:00
|
|
|
|
|
|
|
# The port to connect in order to send an xmlrpc request. The default
|
|
|
|
# port is 2633
|
2017-04-26 04:57:15 +00:00
|
|
|
OPENNEBULA_PORT = env('OPENNEBULA_PORT')
|
2017-04-24 16:51:11 +00:00
|
|
|
|
|
|
|
# The endpoint to which the XML RPC request needs to be sent to. The
|
|
|
|
# default value is /RPC2
|
2017-04-26 04:57:15 +00:00
|
|
|
OPENNEBULA_ENDPOINT = env('OPENNEBULA_ENDPOINT')
|
2017-06-19 06:59:22 +00:00
|
|
|
|
2017-08-14 20:59:01 +00:00
|
|
|
# The public ssh key of the oneadmin user
|
|
|
|
ONEADMIN_USER_SSH_PUBLIC_KEY = env('ONEADMIN_USER_SSH_PUBLIC_KEY')
|
|
|
|
|
2017-06-19 06:59:22 +00:00
|
|
|
# dcl email configurations
|
|
|
|
DCL_TEXT = env('DCL_TEXT')
|
|
|
|
DCL_SUPPORT_FROM_ADDRESS = env('DCL_SUPPORT_FROM_ADDRESS')
|
2017-06-27 20:47:30 +00:00
|
|
|
|
2018-01-08 18:50:42 +00:00
|
|
|
DCL_SSH_KEY_NAME_PREFIX = 'dcl-gen-key-'
|
|
|
|
|
2017-06-27 20:47:30 +00:00
|
|
|
# Settings for Google analytics
|
2017-06-29 22:23:35 +00:00
|
|
|
GOOGLE_ANALYTICS_PROPERTY_IDS = {
|
2017-07-13 19:53:15 +00:00
|
|
|
'ungleich.ch': 'UA-62285904-1',
|
2017-06-30 05:44:39 +00:00
|
|
|
'digitalglarus.ch': 'UA-62285904-2',
|
2017-07-13 19:53:15 +00:00
|
|
|
'blog.ungleich.ch': 'UA-62285904-4',
|
2017-08-23 19:50:32 +00:00
|
|
|
'rails-hosting.ch': 'UA-62285904-5',
|
|
|
|
'django-hosting.ch': 'UA-62285904-6',
|
|
|
|
'node-hosting.ch': 'UA-62285904-7',
|
|
|
|
'datacenterlight.ch': 'UA-62285904-8',
|
|
|
|
'devuanhosting.ch': 'UA-62285904-9',
|
2018-03-14 20:51:13 +00:00
|
|
|
'devuanhosting.com': 'UA-62285904-9',
|
2017-08-23 19:50:32 +00:00
|
|
|
'ipv6onlyhosting.ch': 'UA-62285904-10',
|
2018-03-14 20:51:13 +00:00
|
|
|
'ipv6onlyhosting.net': 'UA-62285904-10',
|
|
|
|
'ipv6onlyhosting.com': 'UA-62285904-10',
|
2018-06-19 06:49:21 +00:00
|
|
|
'comic.ungleich.ch': 'UA-62285904-13',
|
2017-07-02 20:00:56 +00:00
|
|
|
'127.0.0.1:8000': 'localhost',
|
|
|
|
'dynamicweb-development.ungleich.ch': 'development',
|
|
|
|
'dynamicweb-staging.ungleich.ch': 'staging'
|
2017-06-29 22:23:35 +00:00
|
|
|
}
|
2017-07-04 21:16:27 +00:00
|
|
|
|
2017-08-06 07:00:56 +00:00
|
|
|
# CELERY Settings
|
2017-08-06 14:51:07 +00:00
|
|
|
CELERY_BROKER_URL = env('CELERY_BROKER_URL')
|
|
|
|
CELERY_RESULT_BACKEND = env('CELERY_RESULT_BACKEND')
|
2017-08-06 07:00:56 +00:00
|
|
|
CELERY_ACCEPT_CONTENT = ['application/json']
|
|
|
|
CELERY_TASK_SERIALIZER = 'json'
|
|
|
|
CELERY_RESULT_SERIALIZER = 'json'
|
2017-09-15 11:09:46 +00:00
|
|
|
# CELERY_TIMEZONE = 'Europe/Zurich'
|
2017-08-06 16:39:45 +00:00
|
|
|
CELERY_MAX_RETRIES = int_env('CELERY_MAX_RETRIES', 5)
|
2017-08-06 07:00:56 +00:00
|
|
|
|
2017-09-15 11:10:11 +00:00
|
|
|
DCL_ERROR_EMAILS_TO = env('DCL_ERROR_EMAILS_TO')
|
2017-09-15 11:09:46 +00:00
|
|
|
|
|
|
|
DCL_ERROR_EMAILS_TO_LIST = []
|
|
|
|
if DCL_ERROR_EMAILS_TO is not None:
|
2018-02-27 22:52:48 +00:00
|
|
|
DCL_ERROR_EMAILS_TO_LIST = [
|
|
|
|
x.strip() for x in DCL_ERROR_EMAILS_TO.split(',')
|
|
|
|
] if "," in DCL_ERROR_EMAILS_TO else [DCL_ERROR_EMAILS_TO.strip()]
|
2017-09-15 11:09:46 +00:00
|
|
|
|
|
|
|
if 'info@ungleich.ch' not in DCL_ERROR_EMAILS_TO_LIST:
|
|
|
|
DCL_ERROR_EMAILS_TO_LIST.append('info@ungleich.ch')
|
|
|
|
|
2017-11-29 06:32:17 +00:00
|
|
|
ENABLE_LOGGING = bool_env('ENABLE_LOGGING')
|
2017-11-29 05:45:09 +00:00
|
|
|
MODULES_TO_LOG = env('MODULES_TO_LOG')
|
2017-11-29 06:07:03 +00:00
|
|
|
LOG_LEVEL = env('LOG_LEVEL')
|
2017-11-29 05:45:09 +00:00
|
|
|
|
2017-11-29 06:07:03 +00:00
|
|
|
if LOG_LEVEL is None:
|
|
|
|
LOG_LEVEL = 'DEBUG'
|
2017-11-29 05:45:09 +00:00
|
|
|
|
2017-11-29 06:32:17 +00:00
|
|
|
if ENABLE_LOGGING:
|
|
|
|
loggers_dict = {}
|
|
|
|
handlers_dict = {}
|
|
|
|
if MODULES_TO_LOG is None:
|
|
|
|
# set MODULES_TO_LOG to django, if it is not set
|
|
|
|
MODULES_TO_LOG = 'django'
|
2017-12-01 20:03:59 +00:00
|
|
|
modules_to_log_list = MODULES_TO_LOG.split(',')
|
|
|
|
for custom_module in modules_to_log_list:
|
2017-11-29 05:45:09 +00:00
|
|
|
logger_item = {
|
2017-12-01 20:03:59 +00:00
|
|
|
custom_module: {
|
2017-11-29 05:45:09 +00:00
|
|
|
'handlers': ['custom_file'],
|
2017-11-29 06:07:03 +00:00
|
|
|
'level': LOG_LEVEL,
|
2017-11-29 05:45:09 +00:00
|
|
|
'propagate': True
|
|
|
|
}
|
|
|
|
}
|
|
|
|
loggers_dict.update(logger_item)
|
|
|
|
|
|
|
|
custom_handler_item = {
|
|
|
|
'custom_file': {
|
2017-11-29 06:07:03 +00:00
|
|
|
'level': LOG_LEVEL,
|
2017-11-29 05:45:09 +00:00
|
|
|
'class': 'logging.FileHandler',
|
|
|
|
'filename':
|
2017-11-29 06:32:17 +00:00
|
|
|
"{PROJECT_DIR}/{LEVEL}.log".format(
|
2017-11-29 06:07:03 +00:00
|
|
|
LEVEL=LOG_LEVEL.lower(),
|
2017-11-29 05:45:09 +00:00
|
|
|
PROJECT_DIR=PROJECT_DIR
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
handlers_dict.update(custom_handler_item)
|
|
|
|
LOGGING = {
|
|
|
|
'version': 1,
|
|
|
|
'disable_existing_loggers': False,
|
|
|
|
'handlers': handlers_dict,
|
|
|
|
'loggers': loggers_dict
|
2017-07-28 10:05:14 +00:00
|
|
|
}
|
|
|
|
|
2017-09-14 13:05:28 +00:00
|
|
|
TEST_MANAGE_SSH_KEY_PUBKEY = env('TEST_MANAGE_SSH_KEY_PUBKEY')
|
|
|
|
TEST_MANAGE_SSH_KEY_HOST = env('TEST_MANAGE_SSH_KEY_HOST')
|
|
|
|
|
2018-07-18 19:48:39 +00:00
|
|
|
X_FRAME_OPTIONS_ALLOW_FROM_URI = env('X_FRAME_OPTIONS_ALLOW_FROM_URI')
|
|
|
|
X_FRAME_OPTIONS = ('SAMEORIGIN' if X_FRAME_OPTIONS_ALLOW_FROM_URI is None else
|
|
|
|
'ALLOW-FROM {}'.format(
|
|
|
|
X_FRAME_OPTIONS_ALLOW_FROM_URI.strip()
|
|
|
|
))
|
|
|
|
|
2017-07-04 21:16:27 +00:00
|
|
|
DEBUG = bool_env('DEBUG')
|
|
|
|
|
|
|
|
if DEBUG:
|
2017-07-28 10:05:14 +00:00
|
|
|
from .local import * # flake8: noqa
|
2017-07-04 21:16:27 +00:00
|
|
|
else:
|
2017-07-28 10:05:14 +00:00
|
|
|
from .prod import * # flake8: noqa
|