settings.py 3.3 KB
Newer Older
Christophe Siraut's avatar
Christophe Siraut 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 30 31 32 33 34 35 36 37 38 39 40 41
# -*- 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

TEMPLATE_DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'sorl.thumbnail',
    'ckeditor',
42 43
    'flyers.content',
    'flyers.general'
Christophe Siraut's avatar
Christophe Siraut committed
44 45 46 47 48 49 50
)

MIDDLEWARE_CLASSES = (
    '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',
Christophe Siraut's avatar
Christophe Siraut committed
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

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'),
Christophe Siraut's avatar
Christophe Siraut 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 89
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
Christophe Siraut's avatar
Christophe Siraut committed
90
MEDIA_URL = '/media/'
chris's avatar
chris committed
91
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
92

Christophe Siraut's avatar
Christophe Siraut committed
93
CKEDITOR_UPLOAD_PATH = os.path.join(BASE_DIR, 'media', 'uploads')
94 95 96 97 98 99 100
CKEDITOR_CONFIGS = {
    'default': {
        'toolbar_Full': [
            ['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[*]'

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

from django.conf import global_settings
TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + (
110
    'flyers.content.context_processors.menu',
chris's avatar
chris committed
111
    'flyers.general.context_processors.general',
Christophe Siraut's avatar
Christophe Siraut committed
112 113 114
)

LANGUAGE_CODE = 'fr-be'
Christophe Siraut's avatar
Christophe Siraut committed
115 116
SITE_MULTILINGUAL = False
'''
Christophe Siraut's avatar
Christophe Siraut committed
117 118 119 120 121 122
LANGUAGES = (
    ('en', 'English'),
    ('fr', 'Français'),
    ('es', 'Español'),
    ('ca', 'Català'),
)
Christophe Siraut's avatar
Christophe Siraut committed
123
'''
chris's avatar
chris committed
124 125 126 127 128

try:
        from local_settings import *
except ImportError, e:
        pass
Christophe Siraut's avatar
Christophe Siraut committed
129 130 131 132

if SITE_MULTILINGUAL:
    MODELTRANSLATION_TRANSLATION_REGISTRY = ('flyer.translation',)
    INSTALLED_APPS += ('modeltranslation',)