common_settings.py 2.95 KB
Newer Older
Patrick Colmant's avatar
Patrick Colmant 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 42 43 44 45 46 47 48 49 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 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
# -*- coding: utf-8 -*-
# http://www.doodle.com/srxt9yh5yutqgkp85y6nxczk/admin
# http://www.doodle.com/srxt9yh5yutqgkp8
from settings import *

import os
gettext = lambda s: s
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))

###################### Django
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'pi',                      # Or path to database file if using sqlite3.
        # The following settings are not used with sqlite3:
        'USER': 'pi',
        'PASSWORD': 'raspberry',
        'HOST': '127.0.0.1',                      # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
        'PORT': '5432',                      # Set to empty string for default.
    }
}

TIME_ZONE = 'Europe/Brussels'
LANGUAGE_CODE = 'fr-BE'
STATIC_ROOT = os.path.join(PROJECT_PATH, "static")
STATIC_URL = "/static/"
MEDIA_ROOT = os.path.join(PROJECT_PATH, "media")
MEDIA_URL = "/media/"
SOUTH_TESTS_MIGRATE = False

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.contrib.auth.context_processors.auth',
    'django.core.context_processors.i18n',
    'django.core.context_processors.request',
    'django.core.context_processors.media',
    'django.core.context_processors.static',
)
INSTALLED_APPS += (
	# 'debug_toolbar',
	'django.contrib.admin',
	'south',
)

##################### Repanier
AUTHENTICATION_BACKENDS = ('repanier.auth_backend.RepanierCustomBackend',)
# ADMIN_LOGIN = 'pise'
# ADMIN_PASSWORD = 'raspberry'
INSTALLED_APPS += (
	'repanier',
)

##################### Django CMS
LANGUAGES = [
	('fr', 'French'),
	('nl', 'Dutch'),
	('en', 'English'),
]

TEMPLATE_DIRS = (
    # The docs say it should be absolute path: PROJECT_PATH is precisely one.
    # Life is wonderful!
    os.path.join(PROJECT_PATH, "templates"),
)
CMS_TEMPLATES = (
    ('template_1.html', 'Template One'),
    ('template_2.html', 'Template Two'),
)

THUMBNAIL_DEBUG = False

MIDDLEWARE_CLASSES += (
    'cms.middleware.multilingual.MultilingualURLMiddleware',
    'cms.middleware.user.CurrentUserMiddleware',
    'cms.middleware.page.CurrentPageMiddleware',
    'cms.middleware.toolbar.ToolbarMiddleware',
)

TEMPLATE_CONTEXT_PROCESSORS += (
    'cms.context_processors.media',
    'sekizai.context_processors.sekizai',
)

INSTALLED_APPS += (
	'djangocms_text_ckeditor',
	'easy_thumbnails',
	'cms',
	'mptt',
	'menus',
	'sekizai',
	'cms.plugins.file',
	'cms.plugins.flash',
	'cms.plugins.googlemap',
	'cms.plugins.link',
	'cms.plugins.picture',
	'cms.plugins.snippet',
	'cms.plugins.teaser',
#	'cms.plugins.text',
	'cms.plugins.video',
	'cms.plugins.twitter',
	'django.contrib.sitemaps',
)
CMS_MENU_TITLE_OVERWRITE = False
CMS_SOFTROOT = True
CMS_PERMISSION = True
CMS_PUBLIC_FOR = 'all'
CMS_MODERATOR = True
CMS_SHOW_START_DATE = False
CMS_SHOW_END_DATE = False
CMS_SEO_FIELDS = True

CKEDITOR_SETTINGS = {
		'language': '{{ language }}',
		'toolbar': 'CMS',
		'skin': 'moono'
}