le75
clone your own copy | download snapshot

Snapshots | iceberg

Inside this repository

settings.py
text/x-python

Download raw (7.8 KB)

import os
gettext = lambda s: s
DATA_DIR = os.path.dirname(os.path.dirname(__file__))
"""
Django settings for le75 project.

Generated by 'django-admin startproject' using Django 1.8.11.

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/
"""

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/


# Application definition


ROOT_URLCONF = 'le75.urls'


WSGI_APPLICATION = 'le75.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases




# Internationalization
# https://docs.djangoproject.com/en/1.8/topics/i18n/

LANGUAGE_CODE = 'fr'

TIME_ZONE = 'Europe/Brussels'

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_DIRS = (
    os.path.join(BASE_DIR, 'le75', 'static'),
)

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    # other finders..
    'compressor.finders.CompressorFinder',
)

COMPRESS_PRECOMPILERS = (
    # ('text/css', './node_modules/.bin/postcss {infile} --map --use postcss-cssnext'),
    ('text/css', './node_modules/.bin/postcss {infile} --use postcss-cssnext'),
)

SITE_ID = 1


TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, 'le75', 'templates'),],
        'OPTIONS': {
            'context_processors': [
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
                'django.template.context_processors.i18n',
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.template.context_processors.media',
                'django.template.context_processors.csrf',
                'django.template.context_processors.tz',
                'sekizai.context_processors.sekizai',
                'django.template.context_processors.static',
                'cms.context_processors.cms_settings'
            ],
            'loaders': [
                'django.template.loaders.filesystem.Loader',
                'django.template.loaders.app_directories.Loader',
                'django.template.loaders.eggs.Loader'
            ],
        },
    },
]


MIDDLEWARE_CLASSES = (
    'cms.middleware.utils.ApphookReloadMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'cms.middleware.user.CurrentUserMiddleware',
    'cms.middleware.page.CurrentPageMiddleware',
    'cms.middleware.toolbar.ToolbarMiddleware',
    'cms.middleware.language.LanguageCookieMiddleware'
)

INSTALLED_APPS = (
    'djangocms_admin_style',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.admin',
    'django.contrib.sites',
    'django.contrib.sitemaps',
    'django.contrib.staticfiles',
    'django.contrib.messages',
    'cms',
    'menus',
    'sekizai',
    'treebeard',
    'djangocms_text_ckeditor',
    'filer',
    'easy_thumbnails',
    'cmsplugin_filer_image',
    'cmsplugin_filer_file',
    'cmsplugin_filer_folder',
    'cmsplugin_filer_teaser',
    'cmsplugin_filer_utils',
    'cmsplugin_filer_video',
    'djangocms_link',
    'reversion', # TODO: remove django reversion which is normally unused
    'djangocms_history',
    'le75',
    'scraper',
    'course',
    'news',
    'ckeditor',
    'cmsplugin_carousel',
    "compressor",
)

LANGUAGES = (
    ## Customize this
    ('fr', gettext('fr')),
    ('en', gettext('en')),
    ('nl', gettext('nl')),
)

LOCALE_PATHS = os.path.join(BASE_DIR, 'locale'),

CMS_LANGUAGES = {
    ## Customize this
    'default': {
        'public': True,
        'hide_untranslated': False,
        'redirect_on_fallback': True,
    },
    1: [
        {
            'public': True,
            'code': 'fr',
            'hide_untranslated': False,
            'name': gettext('fr'),
            'redirect_on_fallback': True,
        },
        {
            'public': True,
            'code': 'en',
            'hide_untranslated': False,
            'name': gettext('en'),
            'redirect_on_fallback': True,
        },
        {
            'public': True,
            'code': 'nl',
            'hide_untranslated': False,
            'name': gettext('nl'),
            'redirect_on_fallback': True,
        },
    ],
}

CMS_TEMPLATES = (
    ## Customize this
    ('simple.html', 'Simple'),
)

CMS_PERMISSION = True

CMS_PLACEHOLDER_CONF = {}


TEXT_ADDITIONAL_TAGS = ('iframe',)

THUMBNAIL_PROCESSORS = (
    'easy_thumbnails.processors.colorspace',
    'easy_thumbnails.processors.autocrop',
    'filer.thumbnail_processors.scale_and_crop_with_subject_location',
    'scraper.thumbnail_processors.effect_processor',
    'easy_thumbnails.processors.filters'
)

CKEDITOR_JQUERY_URL = '/static/lib/jquery.min.js'
CKEDITOR_CONFIGS = {
    'default': {
        'format_tags': 'heading_2;heading_3;normal',
        'format_heading_2': {'element': 'h2', 'name' : 'Titre de niveau 2', 'attributes' : {'class' : 'heading-2'}},
        'format_heading_3': {'element': 'h3', 'name' : 'Titre de niveau 3', 'attributes' : {'class' : 'heading-3'}},
        'format_normal': {'element': 'p', 'name' : 'Texte normal'},
        'toolbar': 'Custom',
        'toolbar_Custom': [
            ['Italic'],
            ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent'],
            ['Link', 'Unlink'],
            ['SpecialChar'],
            ['RemoveFormat', '-', 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'],
            ['Source']
        ]
    }
}

CKEDITOR_SETTINGS = {
    'format_tags': 'heading_2;heading_3;normal',
    'format_heading_2': {'element': 'h2', 'name' : 'Titre de niveau 2', 'attributes' : {'class' : 'heading-2'}},
    'format_heading_3': {'element': 'h3', 'name' : 'Titre de niveau 3', 'attributes' : {'class' : 'heading-3'}},
    'format_normal': {'element': 'p', 'name' : 'Texte normal'},
    'toolbar_CMS': [
        ['Undo', 'Redo'],
        ['cmsplugins', 'cmswidget', '-', 'ShowBlocks'],
        ['Format', 'Styles', 'CreateDiv'],
        ['PasteText', 'PasteFromWord'],
        ['Maximize', ''],
        '/',
        ['Bold', 'Italic', 'Underline', '-', 'Subscript', 'Superscript', '-', 'RemoveFormat'],
        ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Table'],
        ['Source']
    ],
    'stylesSet': [
        # { 'name': 'Strong Emphasis', 'element': 'strong' },
        # { 'name': 'Emphasis', 'element': 'em' },
        # { 'name': 'Big columns', 'element': ['div', 'ul'], 'attributes': {'class': 'column column--big'}},
        { 'name': 'Big columns', 'element': 'div', 'attributes': {'class': 'column column--big'}},
        { 'name': 'Small columns', 'element': 'div', 'attributes': {'class': 'column column--small'}},
        { 'name': 'Bullet-list', 'element': 'ul', 'attributes': {'class': 'bullet-list'}},
        { 'name': 'Zigzag list', 'element': 'ul', 'attributes': {'class': 'zigzag-list'}},
    ]
}


INTERNAL_IPS = ('127.0.0.1',)


try:
    LOCAL_SETTINGS
except NameError:
    try:
        from le75.local_settings import *
    except ImportError:
        pass