common_settings.py 33.2 KB
Newer Older
Patrick Colmant's avatar
Patrick Colmant committed
1
# -*- coding: utf-8 -*-
Patrick's avatar
Patrick committed
2 3 4
import ConfigParser
import codecs
import logging
Patrick's avatar
Patrick committed
5 6 7 8 9

from django.utils.translation import get_language_info
from django.utils.translation import ugettext_lazy as _

from repanier.const import *
Patrick Colmant's avatar
Patrick Colmant committed
10 11
from settings import *

Patrick Colmant's avatar
Patrick Colmant committed
12
import os
Patrick's avatar
Patrick committed
13

Patrick Colmant's avatar
Patrick Colmant committed
14
gettext = lambda s: s
Patrick's avatar
Patrick committed
15

Patrick's avatar
Patrick committed
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

def get_allowed_mail_extension():
    allowed_mail_extension = "@%s" % DJANGO_SETTINGS_ALLOWED_HOSTS[0]
    cut_index = len(DJANGO_SETTINGS_ALLOWED_HOSTS[0]) - 1
    point_counter = 0
    while cut_index >= 0:
        if DJANGO_SETTINGS_ALLOWED_HOSTS[0][cut_index] == ".":
            point_counter += 1
            if point_counter == 2:
                allowed_mail_extension = "@%s" % DJANGO_SETTINGS_ALLOWED_HOSTS[0][cut_index + 1:]
                break
        cut_index -= 1
    if allowed_mail_extension.endswith("local"):
        allowed_mail_extension = "@repanier.be"
    return allowed_mail_extension

Patrick's avatar
Patrick committed
32 33
# os.path.realpath resolves symlinks and os.path.abspath doesn't.
PROJECT_PATH = os.path.split(os.path.realpath(os.path.dirname(__file__)))[0]
Patrick Colmant's avatar
Patrick Colmant committed
34
PROJECT_DIR = os.path.realpath(os.path.dirname(__file__))
Patrick's avatar
Patrick committed
35 36
os.sys.path.insert(0, PROJECT_PATH)
MEDIA_ROOT = os.path.join(PROJECT_DIR, "media", "public")
Patrick's avatar
Patrick committed
37
MEDIA_URL = "%s%s%s" % (os.sep, "media", os.sep)
Patrick's avatar
Patrick committed
38
STATIC_ROOT = os.path.join(PROJECT_DIR, "collect-static")
Patrick's avatar
Patrick committed
39
STATIC_URL = "%s%s%s" % (os.sep, "static_001", os.sep)
Patrick's avatar
Patrick committed
40 41 42 43
# STATICFILES_DIRS = (
#     os.path.join(PROJECT_PATH, "repanier", "static"),
# )

Patrick's avatar
Patrick committed
44
DJANGO_SETTINGS_SITE_NAME = os.path.split(PROJECT_DIR)[-1]
Patrick's avatar
Patrick committed
45
config = ConfigParser.RawConfigParser(allow_no_value=True)
Patrick's avatar
Patrick committed
46
conf_file_name = '%s%s%s.ini' % (
Patrick's avatar
Patrick committed
47
            PROJECT_DIR,
Patrick's avatar
Patrick committed
48 49
            os.sep,
            DJANGO_SETTINGS_SITE_NAME
Patrick's avatar
Patrick committed
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
)
try:
    # Open the file with the correct encoding
    with codecs.open(conf_file_name, 'r', encoding='utf-8') as f:
        config.readfp(f)
    DJANGO_SETTINGS_ADMIN_EMAIL = config.get('DJANGO_SETTINGS', 'DJANGO_SETTINGS_ADMIN_EMAIL')
    DJANGO_SETTINGS_ADMIN_NAME = config.get('DJANGO_SETTINGS', 'DJANGO_SETTINGS_ADMIN_NAME')
    DJANGO_SETTINGS_DATABASE_HOST = config.get('DJANGO_SETTINGS', 'DJANGO_SETTINGS_DATABASE_HOST')
    DJANGO_SETTINGS_DATABASE_NAME = config.get('DJANGO_SETTINGS', 'DJANGO_SETTINGS_DATABASE_NAME')
    DJANGO_SETTINGS_DATABASE_PASSWORD = config.get('DJANGO_SETTINGS', 'DJANGO_SETTINGS_DATABASE_PASSWORD')
    DJANGO_SETTINGS_DATABASE_PORT = config.getint('DJANGO_SETTINGS', 'DJANGO_SETTINGS_DATABASE_PORT')
    DJANGO_SETTINGS_DATABASE_USER = config.get('DJANGO_SETTINGS', 'DJANGO_SETTINGS_DATABASE_USER')
    DJANGO_SETTINGS_DEBUG = config.getboolean('DJANGO_SETTINGS', 'DJANGO_SETTINGS_DEBUG')
    DJANGO_SETTINGS_DEMO = config.getboolean('DJANGO_SETTINGS', 'DJANGO_SETTINGS_DEMO')
    DJANGO_SETTINGS_EMAIL_HOST = config.get('DJANGO_SETTINGS', 'DJANGO_SETTINGS_EMAIL_HOST')
    DJANGO_SETTINGS_EMAIL_HOST_PASSWORD = config.get('DJANGO_SETTINGS', 'DJANGO_SETTINGS_EMAIL_HOST_PASSWORD')
    DJANGO_SETTINGS_EMAIL_HOST_USER = config.get('DJANGO_SETTINGS', 'DJANGO_SETTINGS_EMAIL_HOST_USER')
    DJANGO_SETTINGS_EMAIL_PORT = config.getint('DJANGO_SETTINGS', 'DJANGO_SETTINGS_EMAIL_PORT')
    DJANGO_SETTINGS_EMAIL_USE_SSL = config.getboolean('DJANGO_SETTINGS', 'DJANGO_SETTINGS_EMAIL_USE_TLS')
    DJANGO_SETTINGS_EMAIL_USE_TLS = config.getboolean('DJANGO_SETTINGS', 'DJANGO_SETTINGS_EMAIL_USE_TLS')
    DJANGO_SETTINGS_ENV = config.get('DJANGO_SETTINGS', 'DJANGO_SETTINGS_ENV')
    DJANGO_SETTINGS_LANGUAGE = config.get('DJANGO_SETTINGS', 'DJANGO_SETTINGS_LANGUAGE')
    DJANGO_SETTINGS_LOGGING = config.getboolean('DJANGO_SETTINGS', 'DJANGO_SETTINGS_LOGGING')
    DJANGO_SETTINGS_CACHE = config.get('DJANGO_SETTINGS', 'DJANGO_SETTINGS_CACHE')
    DJANGO_SETTINGS_SESSION = config.get('DJANGO_SETTINGS', 'DJANGO_SETTINGS_SESSION')
Patrick's avatar
Patrick committed
75
    DJANGO_SETTINGS_COUNTRY = config.get('DJANGO_SETTINGS', 'DJANGO_SETTINGS_COUNTRY')
Patrick's avatar
Patrick committed
76 77
    DJANGO_SETTINGS_ALLOWED_HOSTS = []
    for name in config.options('ALLOWED_HOSTS'):
Patrick's avatar
Patrick committed
78 79 80 81
        allowed_host = config.get('ALLOWED_HOSTS', name)
        if allowed_host.startswith("demo"):
            DJANGO_SETTINGS_DEMO = True
        DJANGO_SETTINGS_ALLOWED_HOSTS.append(allowed_host)
Patrick's avatar
Patrick committed
82 83 84
    logging.info("Settings loaded from %s" % (conf_file_name,))
    print ("Settings loaded from %s" % (conf_file_name,))
    print(DJANGO_SETTINGS_ALLOWED_HOSTS)
Patrick's avatar
Patrick committed
85
    DJANGO_SETTINGS_ALLOWED_MAIL_EXTENSION = get_allowed_mail_extension()
Patrick's avatar
Patrick committed
86 87 88 89
except IOError:
    logging.exception("Unable to open %s settings" % (conf_file_name,))
    print ("Unable to open %s settings" % (conf_file_name,))
    raise SystemExit(-1)
Patrick's avatar
Patrick committed
90 91
DJANGO_SETTINGS_DATE = "%d-%m-%Y"
DJANGO_SETTINGS_DATETIME = "%d-%m-%Y %H:%M"
Patrick Colmant's avatar
Patrick Colmant committed
92

Patrick's avatar
Patrick committed
93

Patrick's avatar
Patrick committed
94 95 96 97
###################### DEBUG
# if DJANGO_SETTINGS_DEMO:
    # No debug available in demo mode
    # DJANGO_SETTINGS_DEBUG = False
Patrick's avatar
Patrick committed
98
DEBUG = DJANGO_SETTINGS_DEBUG
Patrick Colmant's avatar
Patrick Colmant committed
99
DEBUG_PROPAGATE_EXCEPTIONS = DEBUG
Patrick's avatar
Patrick committed
100 101
TEMPLATE_DEBUG = False

Patrick's avatar
Patrick committed
102 103
ADMINS = (
    (
Patrick's avatar
Patrick committed
104 105
        DJANGO_SETTINGS_ADMIN_NAME,
        DJANGO_SETTINGS_ADMIN_EMAIL
Patrick's avatar
Patrick committed
106 107
    ),
)
Patrick's avatar
Patrick committed
108
SERVER_EMAIL = "%s%s" % (DJANGO_SETTINGS_ADMIN_NAME, DJANGO_SETTINGS_ALLOWED_MAIL_EXTENSION)
Patrick's avatar
Patrick committed
109
######################
110 111 112

DATABASES = {
    'default': {
113 114
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
Patrick's avatar
Patrick committed
115
        'NAME': DJANGO_SETTINGS_DATABASE_NAME,  # Or path to database file if using sqlite3.
116
        # The following settings are not used with sqlite3:
Patrick's avatar
Patrick committed
117 118
        'USER': DJANGO_SETTINGS_DATABASE_USER,
        'PASSWORD': DJANGO_SETTINGS_DATABASE_PASSWORD,
119
        # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
Patrick's avatar
Patrick committed
120
        'HOST': DJANGO_SETTINGS_DATABASE_HOST,
121
        # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
Patrick's avatar
Patrick committed
122
        'PORT': DJANGO_SETTINGS_DATABASE_PORT,  # Set to empty string for default.
123 124
    }
}
Patrick's avatar
Patrick committed
125 126 127 128 129 130
EMAIL_HOST = DJANGO_SETTINGS_EMAIL_HOST
EMAIL_HOST_USER = DJANGO_SETTINGS_EMAIL_HOST_USER
EMAIL_HOST_PASSWORD = DJANGO_SETTINGS_EMAIL_HOST_PASSWORD
EMAIL_PORT = DJANGO_SETTINGS_EMAIL_PORT
EMAIL_USE_TLS = DJANGO_SETTINGS_EMAIL_USE_TLS
if EMAIL_USE_TLS:
Patrick Colmant's avatar
Patrick Colmant committed
131
    EMAIL_USE_SSL = False
Patrick's avatar
Patrick committed
132 133
else:
    EMAIL_USE_SSL =DJANGO_SETTINGS_EMAIL_USE_SSL
Patrick's avatar
Patrick committed
134 135
# if DEBUG:
#     EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
Patrick Colmant's avatar
Patrick Colmant committed
136 137 138
###################### I18N

TIME_ZONE = 'Europe/Brussels'
Patrick's avatar
Patrick committed
139 140 141 142 143 144 145
USE_TZ = True
# Before 22/02/2014 - DJANGO-CMS LANGUAGE_CODE = 'fr-BE'
USE_L10N = True
USE_THOUSAND_SEPARATOR = True
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
DECIMAL_SEPARATOR = ','
146
# 'fr-be'
Patrick Colmant's avatar
Patrick Colmant committed
147

Patrick's avatar
Patrick committed
148 149 150 151 152 153
SITE_ID = 1
ALLOWED_HOSTS = DJANGO_SETTINGS_ALLOWED_HOSTS
ROOT_URLCONF = '%s.urls' % (DJANGO_SETTINGS_SITE_NAME,)
WSGI_APPLICATION = '%s.wsgi.application' % (DJANGO_SETTINGS_SITE_NAME,)
EMAIL_SUBJECT_PREFIX = '[' + DJANGO_SETTINGS_ALLOWED_HOSTS[0] + ']'
# DEFAULT_FROM_EMAIL Used by PASSWORD RESET
Patrick's avatar
Patrick committed
154
DEFAULT_FROM_EMAIL = "no-reply%s" % DJANGO_SETTINGS_ALLOWED_MAIL_EXTENSION
Patrick Colmant's avatar
Patrick Colmant committed
155

Patrick's avatar
Patrick committed
156 157
USE_X_FORWARDED_HOST = True
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
Patrick's avatar
Patrick committed
158
SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"
Patrick's avatar
Patrick committed
159 160 161
SESSION_COOKIE_HTTPONLY = True
SESSION_FILE_PATH = DJANGO_SETTINGS_SESSION
# SOUTH_TESTS_MIGRATE = DEBUG
Patrick Colmant's avatar
Patrick Colmant committed
162

Patrick's avatar
Patrick committed
163
##################### Django & Django CMS
Patrick Colmant's avatar
Patrick Colmant committed
164 165 166 167
LOCALE_PATHS = (
    os.path.join(PROJECT_DIR, "locale"),
)

Patrick Colmant's avatar
Patrick Colmant committed
168
INSTALLED_APPS = (
Patrick's avatar
Patrick committed
169 170
    'repanier', # ! Important : for template precedence Repanier must be first INSTALLED_APPS after django.contrib
    'djangocms_admin_style',  # note this needs to be above the 'django.contrib.admin' entry
Patrick Colmant's avatar
Patrick Colmant committed
171 172 173
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
Patrick's avatar
Patrick committed
174 175
    'django.contrib.admin',
    'django.contrib.sites',
Patrick Colmant's avatar
Patrick Colmant committed
176
    'django.contrib.sitemaps',
Patrick's avatar
Patrick committed
177 178 179
    'django.contrib.staticfiles',
    'django.contrib.messages',

Patrick Colmant's avatar
Patrick Colmant committed
180
    'djangocms_text_ckeditor',  # note this needs to be above the 'cms' entry
Patrick's avatar
Patrick committed
181 182 183 184 185 186 187
    'django_select2',
    'cmsplugin_filer_file',
    'cmsplugin_filer_folder',
    'cmsplugin_filer_link',
    'cmsplugin_filer_image',
    'cmsplugin_filer_video',
    # 'cmsplugin_filer_utils',
Patrick's avatar
Patrick committed
188
    'cmsplugin_cascade',
Patrick's avatar
Patrick committed
189
    'cmsplugin_cascade.clipboard',  # optional
Patrick's avatar
Patrick committed
190 191
    'cmsplugin_cascade.extra_fields',  # optional
    'cmsplugin_cascade.sharable',  # optional
Patrick's avatar
Patrick committed
192
    'cmsplugin_cascade.segmentation',  # optiona
Patrick Colmant's avatar
Patrick Colmant committed
193
    'cms',
Patrick's avatar
Patrick committed
194
    # 'cms_bootstrap3',
Patrick Colmant's avatar
Patrick Colmant committed
195
    'menus',
Patrick's avatar
Patrick committed
196 197
    'treebeard',
    'filer',
Patrick Colmant's avatar
Patrick Colmant committed
198
    'easy_thumbnails',
Patrick's avatar
Patrick committed
199
    'easy_thumbnails.optimize',
Patrick's avatar
Patrick committed
200
    # 'sass_processor',
Patrick's avatar
Patrick committed
201
    'sekizai',
Patrick's avatar
Patrick committed
202 203
    'mptt',
    'django_mptt_admin',
Patrick Colmant's avatar
Patrick Colmant committed
204
    'reversion',
Patrick's avatar
Patrick committed
205
    # 'aldryn_reversion',
Patrick Colmant's avatar
Patrick Colmant committed
206
    'parler',
Patrick's avatar
Patrick committed
207
    'import_export',
Patrick's avatar
Patrick committed
208 209
    'rest_framework',
    'easy_select2',
210
    'djng',
Patrick Colmant's avatar
Patrick Colmant committed
211 212
)

Patrick's avatar
Patrick committed
213 214 215
# https://docs.djangoproject.com/fr/1.9/ref/middleware/
# http://docs.django-cms.org/en/develop/how_to/caching.html

Patrick Colmant's avatar
Patrick Colmant committed
216 217
MIDDLEWARE_CLASSES = (
    'django.middleware.cache.UpdateCacheMiddleware',
Patrick's avatar
Patrick committed
218
    'cms.middleware.utils.ApphookReloadMiddleware',
Patrick Colmant's avatar
Patrick Colmant committed
219
    'django.contrib.sessions.middleware.SessionMiddleware',
Patrick's avatar
Patrick committed
220
    'django.middleware.csrf.CsrfViewMiddleware',
Patrick Colmant's avatar
Patrick Colmant committed
221 222 223
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.locale.LocaleMiddleware',
Patrick's avatar
Patrick committed
224
    'django.middleware.common.CommonMiddleware',
Patrick's avatar
Patrick committed
225
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
Patrick Colmant's avatar
Patrick Colmant committed
226
    'cms.middleware.user.CurrentUserMiddleware',
Patrick's avatar
Patrick committed
227
    'cms.middleware.page.CurrentPageMiddleware',
Patrick Colmant's avatar
Patrick Colmant committed
228
    'cms.middleware.toolbar.ToolbarMiddleware',
Patrick's avatar
Patrick committed
229
    'cms.middleware.language.LanguageCookieMiddleware',
Patrick's avatar
Cleanup  
Patrick committed
230
    'django.middleware.cache.FetchFromCacheMiddleware',
Patrick Colmant's avatar
Patrick Colmant committed
231
)
Patrick Colmant's avatar
Patrick Colmant committed
232

Patrick's avatar
Patrick committed
233 234 235 236 237 238
TEMPLATES = [
{
    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': [
        os.path.join(PROJECT_DIR, "templates"),
    ],
Patrick's avatar
Patrick committed
239
    # 'APP_DIRS': True,
Patrick's avatar
Patrick committed
240 241 242
    'OPTIONS': {
        'context_processors': [
            'django.contrib.auth.context_processors.auth',
Patrick's avatar
Patrick committed
243
            'django.contrib.messages.context_processors.messages',
Patrick's avatar
Patrick committed
244
            'django.template.context_processors.i18n',
Patrick's avatar
Patrick committed
245 246
            'django.template.context_processors.debug',
            'django.template.context_processors.request',
Patrick's avatar
Patrick committed
247 248
            'django.template.context_processors.media',
            'django.template.context_processors.csrf',
Patrick's avatar
Patrick committed
249
            'django.template.context_processors.tz',
Patrick's avatar
Patrick committed
250
            'sekizai.context_processors.sekizai',
Patrick's avatar
Patrick committed
251 252
            'django.template.context_processors.static',
            'cms.context_processors.cms_settings'
Patrick's avatar
Patrick committed
253
        ],
Patrick's avatar
Patrick committed
254 255 256 257 258 259
        'loaders': [
            'django.template.loaders.filesystem.Loader',
            'django.template.loaders.app_directories.Loader',
            'django.template.loaders.eggs.Loader'
        ],
    },
Patrick's avatar
Patrick committed
260 261
},
]
Patrick Colmant's avatar
Patrick Colmant committed
262

Patrick Colmant's avatar
Patrick Colmant committed
263
MIGRATION_MODULES = {
Patrick's avatar
Patrick committed
264 265 266
    # 'cms': 'cms.migrations_django',
    # 'menus': 'menus.migrations_django',
    # 'filer': 'filer.migrations_django',
Patrick's avatar
Patrick committed
267 268 269 270 271 272
    # 'djangocms_text_ckeditor': 'djangocms_text_ckeditor.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_image': 'cmsplugin_filer_image.migrations_django',
    # 'cmsplugin_filer_video': 'cmsplugin_filer_video.migrations_django',
Patrick Colmant's avatar
Patrick Colmant committed
273 274
}

275
CMS_PERMISSION = False  # When set to True, don't forget 'cms.middleware.user.CurrentUserMiddleware'
Patrick Colmant's avatar
Patrick Colmant committed
276
CMS_PUBLIC_FOR = 'all'
Patrick Colmant's avatar
Patrick Colmant committed
277
# CMS_PUBLIC_FOR = 'staff'
Patrick Colmant's avatar
Patrick Colmant committed
278 279 280 281 282 283
CMS_SHOW_START_DATE = False
CMS_SHOW_END_DATE = False
CMS_SEO_FIELDS = False
CMS_URL_OVERWRITE = True
CMS_MENU_TITLE_OVERWRITE = True
CMS_REDIRECTS = True
Patrick's avatar
Patrick committed
284

Patrick's avatar
Patrick committed
285
CKEDITOR_SETTINGS = {
286
    'language': '{{ language }}',
Patrick Colmant's avatar
Patrick Colmant committed
287 288 289
    'toolbar_CMS': [
        ['Undo', 'Redo'],
        ['cmsplugins', '-', 'ShowBlocks'],
290
        ['Format',],
Patrick Colmant's avatar
Patrick Colmant committed
291 292 293 294 295 296 297 298 299 300 301 302
        ['TextColor', 'BGColor', '-', 'PasteText'],
        ['Maximize', ''],
        '/',
        ['Bold', 'Italic', 'Underline', '-', 'Subscript', 'Superscript', '-', 'RemoveFormat'],
        ['JustifyLeft', 'JustifyCenter', 'JustifyRight'],
        ['HorizontalRule'],
        ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Table'],
        ['Source']
    ],
    'toolbar_HTMLField': [
        ['Format', 'Bold', 'Italic', 'TextColor', '-', 'NumberedList', 'BulletedList', 'RemoveFormat'],
        ['Preview', 'Cut', 'Copy', 'PasteText', 'Link', '-', 'Undo', 'Redo'],
Patrick's avatar
Patrick committed
303
        ['Source']
Patrick Colmant's avatar
Patrick Colmant committed
304 305
    ],
    'forcePasteAsPlainText': 'true',
Patrick's avatar
Cleanup  
Patrick committed
306
    'skin': 'moono',
307 308
    # 'stylesSet' : 'my_styles:%sjs/ckeditor-styles.js' % STATIC_URL,
    # 'stylesSet' : [],
Patrick Colmant's avatar
Patrick Colmant committed
309 310
    # 'extraPlugins': 'cmsplugins',
    'format_tags': 'p;h4;h5;blockquote;mutted;success;info;danger;heart;pushpin',
311 312 313 314 315 316 317 318 319 320 321 322 323 324
    'format_blockquote': {'element': 'blockquote', 'name': 'Blockquote'},
    'format_heart': {'element': 'span', 'attributes': {'class': 'glyphicon glyphicon-heart-empty'}},
    'format_infosign': {'element': 'span', 'attributes': {'class': 'glyphicon glyphicon-info-sign'}},
    'format_warningsign': {'element': 'span', 'attributes': {'class': 'glyphicon glyphicon-warning-sign'}},
    'format_pushpin': {'element': 'span', 'attributes': {'class': 'glyphicon glyphicon-pushpin'}},
    'format_mutted': {'element': 'p', 'attributes': {'class': 'text-muted'}, 'name': 'Mutted'},
    'format_success': {'element': 'p', 'attributes': {'class': 'bg-success'}, 'name': 'Success'},
    'format_info': {'element': 'p', 'attributes': {'class': 'bg-info'}, 'name': 'Info'},
    'format_danger': {'element': 'p', 'attributes': {'class': 'bg-danger'}, 'name': 'Danger'},
    # format_p = { element: 'p', attributes: { 'class': 'normalPara' } };
    # format_test = { element : 'span', attributes : { 'class' : 'test' }, styles: { color: 'blue'} };
    # 'contentsCss' : '//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css',
    'contentsCss': '%sbootstrap/css/bootstrap.css' % STATIC_URL,
    # 'extraAllowedContent' : '*(*)',
325 326 327 328 329 330
    # 'extraAllowedContent' : 'iframe[*]',
    # 'removeFormatTags': 'big,code,del,dfn,em,font,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,u,var',
    # NOTE: Some versions of CKEditor will pre-sanitize your text before
    # passing it to the web server, rendering the above settings useless.
    # To ensure this does not happen, you may need to add
    # the following parameters to CKEDITOR_SETTINGS:
Patrick Colmant's avatar
Patrick Colmant committed
331 332
    'basicEntities': False,
    'entities': False,
Patrick's avatar
Patrick committed
333
    'enterMode' : 2,
334
    # Do not dispaly the HTML Path below the edit window
Patrick Colmant's avatar
Patrick Colmant committed
335 336 337 338 339 340 341 342
    'removePlugins': 'elementspath',
}

CKEDITOR_SETTINGS_MODEL2 = {
    'language': '{{ language }}',
    'toolbar_HTMLField': [
        ['Format', 'Bold', 'Italic', 'TextColor', '-', 'NumberedList', 'BulletedList', 'RemoveFormat'],
        ['Preview', 'Cut', 'Copy', 'PasteText', 'Link', '-', 'Undo', 'Redo'],
Patrick's avatar
Patrick committed
343 344
        ['Source']
        # ['Maximize', '']
Patrick Colmant's avatar
Patrick Colmant committed
345 346 347 348 349
    ],
    'forcePasteAsPlainText': 'true',
    'skin': 'moono',
    'format_tags': 'p;h4;h5',
    'contentsCss': '%sbootstrap/css/bootstrap.css' % STATIC_URL,
Patrick's avatar
Patrick committed
350
    'removeFormatTags': 'iframe,big,code,del,dfn,em,font,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,u,var',
Patrick Colmant's avatar
Patrick Colmant committed
351 352
    'basicEntities': False,
    'entities': False,
Patrick's avatar
Patrick committed
353
    'enterMode' : 2,
Patrick Colmant's avatar
Patrick Colmant committed
354
    'removePlugins': 'elementspath',
Patrick's avatar
Patrick committed
355 356
}

Patrick's avatar
Patrick committed
357
TEXT_SAVE_IMAGE_FUNCTION = 'cmsplugin_filer_image.integrations.ckeditor.create_image_plugin'
Patrick's avatar
Cleanup  
Patrick committed
358
# TEXT_SAVE_IMAGE_FUNCTION = 'djangocms_text_ckeditor.picture_save.create_picture_plugin'
Patrick's avatar
Patrick committed
359 360
# TEXT_SAVE_IMAGE_FUNCTION = None

361 362 363 364 365 366 367 368
# djangocms-text-ckeditor uses html5lib to sanitize HTML
# to avoid security issues and to check for correct HTML code.
# Sanitisation may strip tags usesful for some use cases such as iframe;
# you may customize the tags and attributes allowed by overriding
# the TEXT_ADDITIONAL_TAGS and TEXT_ADDITIONAL_ATTRIBUTES settings:
TEXT_ADDITIONAL_TAGS = ('span', 'iframe',)
TEXT_ADDITIONAL_ATTRIBUTES = ('class', 'scrolling', 'allowfullscreen', 'frameborder')
TEXT_HTML_SANITIZE = True
Patrick Colmant's avatar
Patrick Colmant committed
369 370 371

FILER_ENABLE_LOGGING = False
FILER_IMAGE_USE_ICON = True
Patrick's avatar
Patrick committed
372 373
FILER_ALLOW_REGULAR_USERS_TO_ADD_ROOT_FOLDERS = True
FILER_ENABLE_PERMISSIONS = False
Patrick Colmant's avatar
Patrick Colmant committed
374 375
FILER_IS_PUBLIC_DEFAULT = True
FILER_SUBJECT_LOCATION_IMAGE_DEBUG = True
Patrick's avatar
Patrick committed
376
FILER_DUMP_PAYLOAD = True
Patrick Colmant's avatar
Patrick Colmant committed
377
FILER_DEBUG = False
Patrick Colmant's avatar
Patrick Colmant committed
378 379 380 381 382 383 384

THUMBNAIL_PROCESSORS = (
    'easy_thumbnails.processors.colorspace',
    'easy_thumbnails.processors.autocrop',
    #'easy_thumbnails.processors.scale_and_crop',
    'filer.thumbnail_processors.scale_and_crop_with_subject_location',
    'easy_thumbnails.processors.filters',
Patrick's avatar
Patrick committed
385
    'easy_thumbnails.processors.background',
Patrick Colmant's avatar
Patrick Colmant committed
386
)
Patrick Colmant's avatar
Patrick Colmant committed
387
THUMBNAIL_HIGH_RESOLUTION = True
Patrick's avatar
Patrick committed
388 389
THUMBNAIL_PROGRESSIVE = 100
THUMBNAIL_PRESERVE_EXTENSIONS = True
Patrick Colmant's avatar
Patrick Colmant committed
390

Patrick's avatar
Patrick committed
391 392 393 394 395 396
THUMBNAIL_OPTIMIZE_COMMAND = {
    'png': '/usr/bin/optipng {filename}',
    'gif': '/usr/bin/optipng {filename}',
    'jpeg': '/usr/bin/jpegoptim {filename}',
}
THUMBNAIL_DEBUG = FILER_DEBUG
Patrick Colmant's avatar
Patrick Colmant committed
397 398

##################### Repanier
399
AUTH_USER_MODEL = 'auth.User'
Patrick Colmant's avatar
Patrick Colmant committed
400
AUTHENTICATION_BACKENDS = ('repanier.auth_backend.RepanierCustomBackend',)
Patrick's avatar
Patrick committed
401
# ADMIN_LOGIN = 'pi'
402
# ADMIN_PASSWORD = 'raspberry'
Patrick Colmant's avatar
Patrick Colmant committed
403 404 405
LOGIN_URL = "/repanier/go_repanier/"
LOGIN_REDIRECT_URL = "/"
LOGOUT_URL = "/repanier/leave_repanier/"
Patrick Colmant's avatar
Patrick Colmant committed
406

Patrick Colmant's avatar
Patrick Colmant committed
407
################# Django_crispy_forms
Patrick Colmant's avatar
Patrick Colmant committed
408 409 410 411
INSTALLED_APPS += (
    'crispy_forms',
    # 'crispy_forms_foundation',
)
Patrick Colmant's avatar
Patrick Colmant committed
412

Patrick Colmant's avatar
Patrick Colmant committed
413 414
CRISPY_TEMPLATE_PACK = "bootstrap3"
# # CRISPY_TEMPLATE_PACK = "foundation"
Patrick's avatar
Cleanup  
Patrick committed
415
# JSON_MODULE = 'ujson'
Patrick Colmant's avatar
Patrick Colmant committed
416

Patrick Colmant's avatar
Patrick Colmant committed
417 418 419
################# Django_compressor
INSTALLED_APPS += (
    'compressor',
Patrick Colmant's avatar
Patrick Colmant committed
420
)
Patrick Colmant's avatar
Patrick Colmant committed
421 422 423 424
##### From : django/conf/global_settings.py
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
425
    #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
Patrick Colmant's avatar
Patrick Colmant committed
426 427
)

Patrick Colmant's avatar
Patrick Colmant committed
428
STATICFILES_FINDERS += (
429
    'compressor.finders.CompressorFinder',
Patrick Colmant's avatar
Patrick Colmant committed
430 431
)

Patrick Colmant's avatar
Patrick Colmant committed
432 433 434 435 436 437 438 439 440
COMPRESS_ENABLED = True
COMPRESS_OUTPUT_DIR = "compressor"
COMPRESS_STORAGE = 'compressor.storage.GzipCompressorFileStorage'
COMPRESS_PARSER = "compressor.parser.HtmlParser"
COMPRESS_OFFLINE = False

###################### Django : Cache setup (https://docs.djangoproject.com/en/dev/topics/cache/)

CACHE_MIDDLEWARE_ALIAS = 'default'
Patrick's avatar
Patrick committed
441
CACHE_MIDDLEWARE_SECONDS = 3600
Patrick Colmant's avatar
Patrick Colmant committed
442

Patrick's avatar
Patrick committed
443 444 445 446 447 448 449 450 451 452 453
CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
        'LOCATION': os.path.join(DJANGO_SETTINGS_CACHE, ALLOWED_HOSTS[0]),
        'TIMEOUT': 300,
        'OPTIONS': {
            'MAX_ENTRIES': 1000,
            'CULL_FREQUENCY': 3
        }
    }
}
Patrick Colmant's avatar
Patrick Colmant committed
454 455

CMS_CACHE_DURATIONS = {
456 457 458 459 460
    'content': 300,  # default 60
    'menus': 3600,  # default 3600
    'permissions': 3600  # default: 3600
}

Patrick Colmant's avatar
Patrick Colmant committed
461 462 463 464 465
##################### DECIMAL
from decimal import getcontext, ROUND_HALF_UP

getcontext().rounding = ROUND_HALF_UP

Patrick's avatar
Patrick committed
466 467 468 469 470
##################### DJANGO REST_FRAMEWORK
REST_FRAMEWORK = {
    'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.IsAuthenticated',),
    'PAGE_SIZE': 10
}
Patrick's avatar
Patrick committed
471 472 473 474 475

##################### DJANGO IMPORT EXPORT
IMPORT_EXPORT_USE_TRANSACTIONS = True


Patrick's avatar
Patrick committed
476 477
DATE_INPUT_FORMATS = (DJANGO_SETTINGS_DATE, "%d/%m/%Y", "%Y-%m-%d")
DATETIME_INPUT_FORMATS = (DJANGO_SETTINGS_DATETIME,)
Patrick's avatar
Patrick committed
478

Patrick's avatar
Patrick committed
479
if DJANGO_SETTINGS_LOGGING:
Patrick's avatar
Patrick committed
480 481 482 483 484 485 486 487 488 489 490 491 492
    LOGGING = {
        'version': 1,
        'disable_existing_loggers': False,
        'filters': {
            'require_debug_false': {
                '()': 'django.utils.log.RequireDebugFalse'
            }
        },
        'handlers': {
            'mail_admins': {
                'level': 'ERROR',
                'filters': ['require_debug_false'],
                'class': 'django.utils.log.AdminEmailHandler'
Patrick's avatar
Patrick committed
493 494 495
            },
            'console': {
                'level': 'INFO',
Patrick's avatar
Patrick committed
496 497 498 499 500 501 502 503
                'class': 'logging.StreamHandler',
            },
        },
        'loggers': {
            'django.request': {
                'handlers': ['mail_admins'],
                'level': 'ERROR',
                'propagate': True,
Patrick's avatar
Patrick committed
504 505
            },
            'django.db.backends': {
Patrick's avatar
Patrick committed
506 507 508 509 510 511
                'level': 'DEBUG',
                'handlers': ['console'],
            },
        }
    }

512

Patrick's avatar
Patrick committed
513
CMS_TEMPLATES = (
Patrick's avatar
Patrick committed
514 515 516 517 518
    ('cms_page.html', gettext("Internal page")),
    ('cms_subpage.html', gettext("Internal page with menu on left")),
    ('cms_home.html', gettext("Home page")),
    ('cms_bootstrap_page.html', gettext("Bootstrap page")),
    ('cms_bootstrap_subpage.html', gettext("Bootstrap page with menu on left"))
Patrick's avatar
Patrick committed
519
)
520

Patrick's avatar
Patrick committed
521 522 523 524
if DJANGO_SETTINGS_LANGUAGE == 'fr':

    LANGUAGE_CODE = 'fr'
    LANGUAGES = [
Patrick's avatar
Patrick committed
525
        ('fr', get_language_info('fr')['name_local']),
Patrick's avatar
Patrick committed
526 527 528 529 530
    ]
    CMS_LANGUAGES = {
        SITE_ID: [
            {
            'code': 'fr',
Patrick's avatar
Patrick committed
531
            'name': get_language_info('fr')['name'],
Patrick's avatar
Patrick committed
532 533 534 535 536 537 538 539
            'public': True,
            'hide_untranslated': False,
            },
        ]
    }
    PARLER_DEFAULT_LANGUAGE_CODE = LANGUAGE_CODE
    PARLER_LANGUAGES = {
        SITE_ID: (
Patrick's avatar
Patrick committed
540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567
            {'code': LANGUAGE_CODE,},
        ),
        'default': {
            'fallbacks'        : [LANGUAGE_CODE],
            'hide_untranslated': False,
        },
    }

elif DJANGO_SETTINGS_LANGUAGE == 'es':

    LANGUAGE_CODE = 'es'
    LANGUAGES = [
        ('es', get_language_info('es')['name_local']),
    ]
    CMS_LANGUAGES = {
        SITE_ID: [
            {
            'code': 'es',
            'name': get_language_info('es')['name'],
            'public': True,
            'hide_untranslated': False,
            },
        ]
    }
    PARLER_DEFAULT_LANGUAGE_CODE = LANGUAGE_CODE
    PARLER_LANGUAGES = {
        SITE_ID: (
            {'code': LANGUAGE_CODE,},
Patrick's avatar
Patrick committed
568
        ),
Patrick's avatar
Patrick committed
569 570 571 572
        'default': {
            'fallbacks'        : [LANGUAGE_CODE],
            'hide_untranslated': False,
        },
Patrick's avatar
Patrick committed
573 574 575 576 577 578
    }

elif DJANGO_SETTINGS_LANGUAGE == 'fr-nl-en':

    LANGUAGE_CODE = 'fr'
    LANGUAGES = [
Patrick's avatar
Patrick committed
579 580 581
        ('fr', get_language_info('fr')['name_local']),
        ('nl', get_language_info('nl')['name_local']),
        ('en', get_language_info('en')['name_local']),
Patrick's avatar
Patrick committed
582 583 584 585 586
    ]
    CMS_LANGUAGES = {
        SITE_ID: [
            {
                'code': 'fr',
Patrick's avatar
Patrick committed
587
                'name': get_language_info('fr')['name'],
Patrick's avatar
Patrick committed
588 589 590 591 592 593
                'public': True,
                'redirect_on_fallback':False,
                'hide_untranslated': False,
            },
            {
                'code': 'nl',
Patrick's avatar
Patrick committed
594
                'name': get_language_info('nl')['name'],
Patrick's avatar
Patrick committed
595 596 597 598 599
                'fallbacks': ['en', 'fr'],
                'public': True,
            },
            {
                'code': 'en',
Patrick's avatar
Patrick committed
600 601
                'name': get_language_info('en')['name'],
                'fallbacks': [LANGUAGE_CODE],
Patrick's avatar
Patrick committed
602 603 604 605 606 607 608 609 610 611 612 613
                'public': True,
            },
        ]
    }
    PARLER_DEFAULT_LANGUAGE_CODE = LANGUAGE_CODE
    PARLER_LANGUAGES = {
        SITE_ID: (
            {'code': 'fr',},
            {'code': 'nl',},
            {'code': 'en',},
        ),
        'default': {
Patrick's avatar
Patrick committed
614
                'fallbacks': [LANGUAGE_CODE],
Patrick's avatar
Patrick committed
615 616 617
                'hide_untranslated': False,
        },
    }
Patrick's avatar
Patrick committed
618
elif DJANGO_SETTINGS_LANGUAGE == 'fr-en':
Patrick's avatar
Patrick committed
619

Patrick's avatar
Patrick committed
620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673
    LANGUAGE_CODE = 'fr'
    LANGUAGES = [
        ('fr', get_language_info('fr')['name_local']),
        ('en', get_language_info('en')['name_local']),
    ]
    CMS_LANGUAGES = {
        SITE_ID: [
            {
                'code': 'fr',
                'name': get_language_info('fr')['name'],
                'public': True,
                'redirect_on_fallback':False,
                'hide_untranslated': False,
            },
            {
                'code': 'en',
                'name': get_language_info('en')['name'],
                'fallbacks': [LANGUAGE_CODE],
                'public': True,
            },
        ]
    }
    PARLER_DEFAULT_LANGUAGE_CODE = LANGUAGE_CODE
    PARLER_LANGUAGES = {
        SITE_ID: (
            {'code': 'fr',},
            {'code': 'en',},
        ),
        'default': {
                'fallbacks': [LANGUAGE_CODE],
                'hide_untranslated': False,
        },
    }

##################### DJANGOCMS-CASCADE
CMSPLUGIN_CASCADE_PLUGINS = (
    'cmsplugin_cascade.generic',
    'cmsplugin_cascade.link',
    'cmsplugin_cascade.sharable',
    'cmsplugin_cascade.bootstrap3',
    'cmsplugin_cascade.segmentation',
)

from cmsplugin_cascade.extra_fields.config import PluginExtraFieldsConfig
CMSPLUGIN_CASCADE = {
    'plugins_with_extra_fields': {
        'BootstrapRowPlugin': PluginExtraFieldsConfig(inline_styles={
            'extra_fields:Margins': ['margin-top', 'margin-bottom'],
            'extra_units:Margins': 'px,em'}),
        'BootstrapJumbotronPlugin': PluginExtraFieldsConfig(inline_styles={
            # 'extra_fields:Margins': ['margin-top', 'margin-bottom'],
            # 'extra_units:Margins': 'px,em',
            'extra_fields:Margins': ['padding-top', 'padding-bottom', 'margin-bottom'],
            'extra_units:Margins': 'px,em'}),
Patrick's avatar
Patrick committed
674
    },
Patrick's avatar
Patrick committed
675 676 677 678 679 680 681 682 683 684 685 686
    'bootstrap3': (
        ('xs', (768, 'mobile', _("mobile phones"), 750, 768)),
        ('sm', (768, 'tablet', _("tablets"), 750, 992)),
        ('md', (992, 'laptop', _("laptops"), 970, 1200)),
        ('lg', (1200, 'desktop', _("large desktops"), 1170, 2500)),
    ),
    'segmentation_mixins': (
        (
            'cmsplugin_cascade.segmentation.mixins.EmulateUserModelMixin',
            'cmsplugin_cascade.segmentation.mixins.EmulateUserAdminMixin',
        ),
    ),
Patrick's avatar
Patrick committed
687 688 689 690 691 692 693 694 695
}

CMS_PLACEHOLDER_CONF = {
    'home-hero': {
        'name': gettext('Hero'),
        'plugins': [
            'TextPlugin',
        ],
        'text_only_plugins': [
696 697
            'TextLinkPlugin',
            # 'FilerLinkPlugin',
Patrick's avatar
Patrick committed
698 699 700
            'FilerImagePlugin',
            'FilerFilePlugin',
            'FilerVideoPlugin'
Patrick's avatar
Patrick committed
701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723
        ],
        'default_plugins': [
            {
                'plugin_type': 'TextPlugin',
                'values': {
                    'body':
                        """
                        <h3>Lorem ipsum</h3>
                        <p>Lorem ipsum.</p>
                        <p class="text-muted"><span class="glyphicon glyphicon-pushpin"></span>&nbsp;Lorem ipsum.</p>
                        <h3>Lorem ipsum</h3>
                        <p class="text-muted">Lorem ipsum.</p>
                        """
                },
            },
        ]
    },
    'home-col-1': {
        'name': gettext('Column 1'),
        'plugins': [
            'TextPlugin',
        ],
        'text_only_plugins': [
724 725
            'TextLinkPlugin',
            # 'FilerLinkPlugin',
Patrick's avatar
Patrick committed
726 727 728
            'FilerImagePlugin',
            'FilerFilePlugin',
            'FilerVideoPlugin'
Patrick's avatar
Patrick committed
729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751
        ],
        'default_plugins': [
            {
                'plugin_type': 'TextPlugin',
                'values': {
                    'body':
                        """
                        <div class="panel panel-info">
                        <div class="panel-heading"><h4>Lorem ipsum</h4></div>
                        <div class="panel-body">
                        <ul class="list-group">
                        <li class="list-group-item">Lorem ipsum.</li>
                        <li class="list-group-item">Lorem ipsum.</li>
                        </ul>
                        </div>
                        </div>
                        """
                },
            },
        ]
    },
    'home-col-2': {
        'name': gettext('Column 2'),
Patrick's avatar
Patrick committed
752
        'plugins'          : [
Patrick's avatar
Patrick committed
753 754 755
            'TextPlugin',
        ],
        'text_only_plugins': [
756 757
            'TextLinkPlugin',
            # 'FilerLinkPlugin',
Patrick's avatar
Patrick committed
758 759 760
            'FilerImagePlugin',
            'FilerFilePlugin',
            'FilerVideoPlugin'
Patrick's avatar
Patrick committed
761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783
        ],
        'default_plugins': [
            {
                'plugin_type': 'TextPlugin',
                'values': {
                    'body':
                        """
                        <div class="panel panel-danger">
                        <div class="panel-heading"><h4>Lorem ipsum</h4></div>
                        <div class="panel-body">
                        <ul class="list-group">
                        <li class="list-group-item">Lorem ipsum.</li>
                        <li class="list-group-item">Lorem ipsum.</li>
                        </ul>
                        </div>
                        </div>
                        """
                },
            },
        ]
    },
    'home-col-3': {
        'name': gettext('Column 3'),
Patrick's avatar
Patrick committed
784
        'plugins'          : [
Patrick's avatar
Patrick committed
785 786 787
            'TextPlugin',
        ],
        'text_only_plugins': [
788 789
            'TextLinkPlugin',
            # 'FilerLinkPlugin',
Patrick's avatar
Patrick committed
790 791 792
            'FilerImagePlugin',
            'FilerFilePlugin',
            'FilerVideoPlugin'
Patrick's avatar
Patrick committed
793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815
        ],
        'default_plugins': [
            {
                'plugin_type': 'TextPlugin',
                'values': {
                    'body':
                        """
                        <div class="panel panel-warning">
                        <div class="panel-heading"><h4>Lorem ipsum</h4></div>
                        <div class="panel-body">
                        <ul class="list-group">
                        <li class="list-group-item">Lorem ipsum.</li>
                        <li class="list-group-item">Lorem ipsum.</li>
                        </ul>
                        </div>
                        </div>
                        """
                },
            },
        ]
    },
    'subpage_content': {
        'name': gettext('Content'),
Patrick's avatar
Patrick committed
816
        'plugins'          : [
Patrick's avatar
Patrick committed
817 818 819
            'TextPlugin',
        ],
        'text_only_plugins': [
Patrick's avatar
Patrick committed
820
            'TextLinkPlugin',
821
            # 'FilerLinkPlugin',
Patrick's avatar
Patrick committed
822 823 824
            'FilerImagePlugin',
            'FilerFilePlugin',
            'FilerVideoPlugin'
Patrick's avatar
Patrick committed
825 826 827 828 829 830 831 832 833 834 835 836 837 838 839
        ],
        'default_plugins': [
            {
                'plugin_type': 'TextPlugin',
                'values': {
                    'body':
                        """
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus tortor quis imperdiet egestas. Proin mollis sem ipsum, nec facilisis nibh cursus eu. Sed convallis cursus venenatis. Maecenas rutrum, elit ut ornare lobortis, mi dolor placerat elit, at laoreet sapien urna vitae arcu. Phasellus consectetur tincidunt ullamcorper. Sed et enim at lacus cursus rhoncus. Vestibulum porttitor velit non ante ullamcorper, ut gravida ipsum vestibulum. Aenean sed condimentum nisi. Quisque sagittis mauris non leo tincidunt vulputate. Ut euismod ante purus, sed pulvinar nisl volutpat quis. Maecenas consequat mi vitae libero egestas varius. Nam in tempor augue, sit amet pulvinar purus.</p>
                        <p>Vestibulum sed elit mollis, dapibus ligula in, ultricies purus. Proin fermentum blandit ultrices. Suspendisse vitae nisi mollis, viverra ipsum vitae, adipiscing lorem. Curabitur vestibulum orci felis, nec pretium arcu elementum a. Curabitur blandit fermentum tellus at consequat. Sed eget tempor elit. Donec in elit purus.</p>
                        <p>Morbi vulputate dolor sed nibh ullamcorper, eget molestie justo adipiscing. Fusce faucibus vel quam eu ultrices. Sed aliquet fringilla tristique. Vestibulum sit amet nunc tincidunt turpis tristique ullamcorper. Nam tempor mi felis, ac vulputate quam varius eget. Nunc blandit nulla vel metus lacinia, sit amet posuere lectus viverra. Praesent vel tortor facilisis, imperdiet orci sed, auctor erat.</p>
                        """
                },
            },
        ]
    },
Patrick's avatar
Patrick committed
840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869
    'bootstrap_content': {
        'name'           : gettext('Bootstrap Content'),
        'plugins'        : [
            'BootstrapContainerPlugin',
            'BootstrapJumbotronPlugin',
        ],
        'text_only_plugins': [
            # 'FilerLinkPlugin',
            'TextLinkPlugin',
            'FilerImagePlugin',
            'FilerFilePlugin',
            'FilerVideoPlugin'
        ],
        'parent_classes' : {
            'BootstrapContainerPlugin': None,
            'BootstrapJumbotronPlugin': None,
        },
        'glossary': {
            'breakpoints': ['xs', 'sm', 'md', 'lg'],
            'container_max_widths': {'xs': 750, 'sm': 750, 'md': 970, 'lg': 1170},
            'fluid': False,
            'media_queries': {
                'xs': ['(max-width: 768px)'],
                'sm': ['(min-width: 768px)', '(max-width: 992px)'],
                'md': ['(min-width: 992px)', '(max-width: 1200px)'],
                'lg': ['(min-width: 1200px)'],
            },
        },
    },

Patrick's avatar
Patrick committed
870 871 872
    'footer': {
        'name': gettext('Footer'),
        'plugins': ['TextPlugin', ],
Patrick's avatar
Patrick committed
873
        'text_only_plugins': ['TextLinkPlugin'],
Patrick's avatar
Patrick committed
874 875 876 877 878 879 880 881 882 883 884 885 886 887 888
        'limits': {
            'TextPlugin': 1,
        },
        'default_plugins': [
            {
                'plugin_type': 'TextPlugin',
                'values': {
                    'body':
                        'Lorem ipsum dolor sit amet'

                },
            },
        ]
    },
}
Patrick's avatar
Patrick committed
889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957

##################### REPANIER VAT/RATE

if DJANGO_SETTINGS_COUNTRY == "ch":
    # Switzerland
    DICT_VAT_DEFAULT = VAT_325
    LUT_VAT = (
        (VAT_100, _('none')),
        (VAT_325, _('vat 2.5%')),
        (VAT_350, _('vat 3.8%')),
        (VAT_430, _('vat 8%')),
    )

    LUT_VAT_REVERSE = (
        (_('none'), VAT_100),
        (_('vat 2.5%'), VAT_325),
        (_('vat 3.8%'), VAT_350),
        (_('vat 8%'), VAT_430),
    )
elif DJANGO_SETTINGS_COUNTRY == "fr":
    # France
    DICT_VAT_DEFAULT = VAT_375
    LUT_VAT = (
        (VAT_100, _('none')),
        (VAT_315, _('vat 2.1%')),
        (VAT_375, _('vat 5.5%')),
        (VAT_460, _('vat 10%')),
        (VAT_590, _('vat 20%')),
    )

    LUT_VAT_REVERSE = (
        (_('none'), VAT_100),
        (_('vat 2.1%'), VAT_315),
        (_('vat 5.5%'), VAT_375),
        (_('vat 10%'), VAT_460),
        (_('vat 20%'), VAT_590),
    )
elif DJANGO_SETTINGS_COUNTRY == "es":
    # Espagne
    DICT_VAT_DEFAULT = VAT_460
    LUT_VAT = (
        (VAT_100, _('none')),
        (VAT_360, _('vat 4%')),
        (VAT_460, _('vat 10%')),
        (VAT_600, _('vat 21%')),
    )

    LUT_VAT_REVERSE = (
        (_('none'), VAT_100),
        (_('vat 4%'), VAT_360),
        (_('vat 10%'), VAT_460),
        (_('vat 21%'), VAT_600),
    )
else:
    # Belgium
    DICT_VAT_DEFAULT = VAT_400
    LUT_VAT = (
        (VAT_100, _('none')),
        (VAT_400, _('vat 6%')),
        (VAT_500, _('vat 12%')),
        (VAT_600, _('vat 21%')),
    )

    LUT_VAT_REVERSE = (
        (_('none'), VAT_100),
        (_('vat 6%'), VAT_400),
        (_('vat 12%'), VAT_500),
        (_('vat 21%'), VAT_600),
    )