settings.py 3.99 KB
Newer Older
chris's avatar
chris committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
# -*- coding: utf-8 -*-
"""
Django settings for flyers project.

For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""

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

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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '$60dfh^63$8#qttdy)ze+w7fy9!m7*v+*_bix8clj(2f61sy&q'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition

chris's avatar
chris committed
30
INSTALLED_APPS = [
chris's avatar
chris committed
31 32 33 34 35 36
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
chris's avatar
chris committed
37
    'modeltranslation',
chris's avatar
chris committed
38 39
    'sorl.thumbnail',
    'ckeditor',
chris's avatar
chris committed
40
    'ckeditor_uploader',
41
    'flyers.content',
chris's avatar
chris committed
42 43
    'flyers.general',
]
chris's avatar
chris committed
44

chris's avatar
chris committed
45 46
MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
chris's avatar
chris committed
47 48 49 50
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
chris's avatar
chris committed
51
    'django.middleware.locale.LocaleMiddleware',
chris's avatar
chris committed
52 53
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
chris's avatar
chris committed
54
]
chris's avatar
chris committed
55 56 57 58 59 60 61 62 63 64 65 66

ROOT_URLCONF = 'flyers.urls'

WSGI_APPLICATION = 'flyers.wsgi.application'


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

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
chris's avatar
chris committed
67
        'NAME': os.path.join(BASE_DIR, 'db.sqlite'),
chris's avatar
chris committed
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
    }
}

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

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.6/howto/static-files/

chris's avatar
chris committed
88
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
chris's avatar
chris committed
89
STATIC_URL = '/static/'
chris's avatar
chris committed
90
MEDIA_URL = '/media/'
chris's avatar
chris committed
91

chris's avatar
chris committed
92
CKEDITOR_UPLOAD_PATH = 'uploads'
chris's avatar
chris committed
93 94
CKEDITOR_CONFIGS = {
    'default': {
chris's avatar
chris committed
95 96
        'toolbar': 'Custom',
        'toolbar_Custom': [
chris's avatar
chris committed
97 98 99 100
            ['Styles', 'Format', 'Bold', 'Italic', 'Underline', 'Strike', 'SpellChecker', 'Undo', 'Redo'],
            ['Image', 'Link', 'Flash', 'Table', 'HorizontalRule'],
            ['TextColor', 'BGColor'],
            ['Smiley', 'SpecialChar'], ['Source'],
chris's avatar
chris committed
101 102 103
        ],
        'extraAllowedContent': 'iframe[*]'

chris's avatar
chris committed
104 105
    },
}
106
CKEDITOR_JQUERY_URL = '//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js'
chris's avatar
chris committed
107

108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [
            # insert your TEMPLATE_DIRS here
        ],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                # Insert your TEMPLATE_CONTEXT_PROCESSORS here or use this
                # list if you haven't customized them:
                'django.contrib.auth.context_processors.auth',
                'django.template.context_processors.debug',
                'django.template.context_processors.i18n',
                'django.template.context_processors.media',
                'django.template.context_processors.static',
                'django.template.context_processors.tz',
                'django.contrib.messages.context_processors.messages',
                'flyers.content.context_processors.menu',
                'flyers.general.context_processors.general',
            ],
        },
    },
]
chris's avatar
chris committed
132 133

LANGUAGE_CODE = 'fr-be'
chris's avatar
chris committed
134
SITE_MULTILINGUAL = False
chris's avatar
chris committed
135
MODELTRANSLATION_ENABLE_REGISTRATIONS = False
chris's avatar
chris committed
136
MENU_FOOTER = ''
137

chris's avatar
chris committed
138 139 140 141
local_settings_file = os.environ.get('FLYERS_SETTINGS',
        os.path.join(os.path.dirname(__file__), 'local_settings.py'))
if os.path.exists(local_settings_file):
    exec(open(local_settings_file).read())