common_settings.py 14.4 KB
Newer Older
Patrick Colmant's avatar
Patrick Colmant committed
1 2 3
# -*- coding: utf-8 -*-
from settings import *

Patrick Colmant's avatar
Patrick Colmant committed
4 5
import os
import sys
Patrick Colmant's avatar
Patrick Colmant committed
6
gettext = lambda s: s
Patrick Colmant's avatar
Patrick Colmant committed
7 8 9
PROJECT_PATH = os.path.split(os.path.abspath(os.path.dirname(__file__)))[0]
PROJECT_DIR = os.path.realpath(os.path.dirname(__file__))
os.sys.path.insert(0, os.path.dirname(PROJECT_DIR))
Patrick Colmant's avatar
Patrick Colmant committed
10

Patrick Colmant's avatar
Patrick Colmant committed
11
###################### DEBUG
Patrick's avatar
Patrick committed
12 13

# Defined into /etc/uwsgi/apps-available/*.ini
14
DEBUG = True if os.getenv('DJANGO_SETTINGS_MODULE_DEBUG', '') == 'True' else False
Patrick's avatar
Patrick committed
15
TEMPLATE_DEBUG = DEBUG
Patrick Colmant's avatar
Patrick Colmant committed
16
DEBUG_PROPAGATE_EXCEPTIONS = DEBUG
Patrick's avatar
Patrick committed
17 18
ADMINS = (
    (
19 20
        os.getenv('DJANGO_SETTINGS_MODULE_ADMIN_NAME', ''),
        os.getenv('DJANGO_SETTINGS_MODULE_ADMIN_EMAIL', '')
Patrick's avatar
Patrick committed
21 22
    ),
)
23
SERVER_EMAIL = os.getenv('DJANGO_SETTINGS_MODULE_ADMIN_EMAIL', '')
Patrick's avatar
Patrick committed
24 25 26 27 28 29
# MANAGERS = (
#     (
#         os.getenv('DJANGO_SETTINGS_MODULE_ADMIN_NAME',''), 
#         os.getenv('DJANGO_SETTINGS_MODULE_ADMIN_EMAIL','')
#     ),
# )
30 31 32 33
###################### 

DATABASES = {
    'default': {
34 35 36
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': os.getenv('DJANGO_SETTINGS_MODULE_DATABASE_NAME', ''),  # Or path to database file if using sqlite3.
37
        # The following settings are not used with sqlite3:
38 39 40 41
        'USER': os.getenv('DJANGO_SETTINGS_MODULE_DATABASE_USER', ''),
        'PASSWORD': os.getenv('DJANGO_SETTINGS_MODULE_DATABASE_PASSWORD', ''),
        # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
        'HOST': os.getenv('DJANGO_SETTINGS_MODULE_DATABASE_HOST', ''),
42
        # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
43
        'PORT': os.getenv('DJANGO_SETTINGS_MODULE_DATABASE_PORT', ''),  # Set to empty string for default.
44 45
    }
}
46 47 48 49 50
EMAIL_HOST = os.getenv('DJANGO_SETTINGS_MODULE_EMAIL_HOST', '')
EMAIL_HOST_USER = os.getenv('DJANGO_SETTINGS_MODULE_EMAIL_HOST_USER', '')
EMAIL_HOST_PASSWORD = os.getenv('DJANGO_SETTINGS_MODULE_EMAIL_HOST_PASSWORD', '')
EMAIL_PORT = os.getenv('DJANGO_SETTINGS_MODULE_EMAIL_PORT', '')
EMAIL_USE_TLS = True if os.getenv('DJANGO_SETTINGS_MODULE_EMAIL_USE_TLS', '') == 'True' else False
Patrick Colmant's avatar
Patrick Colmant committed
51 52 53 54
if not EMAIL_USE_TLS:
    EMAIL_USE_SSL = True if os.getenv('DJANGO_SETTINGS_MODULE_EMAIL_USE_SSL', '') == 'True' else False
else:
    EMAIL_USE_SSL = False
Patrick's avatar
Patrick committed
55 56
# if DEBUG:
#     EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
Patrick Colmant's avatar
Patrick Colmant committed
57 58 59
###################### I18N

TIME_ZONE = 'Europe/Brussels'
Patrick's avatar
Patrick committed
60 61 62 63 64 65 66 67
USE_TZ = True
# Before 22/02/2014 - DJANGO-CMS LANGUAGE_CODE = 'fr-BE'
LANGUAGE_CODE = 'fr'
USE_L10N = True
USE_THOUSAND_SEPARATOR = True
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
DECIMAL_SEPARATOR = ','
68
# 'fr-be'
Patrick Colmant's avatar
Patrick Colmant committed
69 70 71

##################### Django & Django CMS
LANGUAGES = [
Patrick Colmant's avatar
Patrick Colmant committed
72 73 74 75
    ('fr', u'Français'),
    ('nl', u'Neederlands'),
    ('en', u'English'),
    ('it', u'italiano'), ]
Patrick Colmant's avatar
Patrick Colmant committed
76 77

CMS_LANGUAGES = {
Patrick Colmant's avatar
Patrick Colmant committed
78
    'default': {
Patrick Colmant's avatar
Patrick Colmant committed
79
        'fallbacks': ['fr', 'en', 'nl'],
80
        'redirect_on_fallback': True,
Patrick Colmant's avatar
Patrick Colmant committed
81 82
        'public': False,
        'hide_untranslated': False,
Patrick Colmant's avatar
Patrick Colmant committed
83 84 85
    }
}

Patrick Colmant's avatar
Patrick Colmant committed
86 87 88 89
LOCALE_PATHS = (
    os.path.join(PROJECT_DIR, "locale"),
)

Patrick Colmant's avatar
Patrick Colmant committed
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 116 117 118 119 120
INSTALLED_APPS = (
    'django.contrib.sites',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.sitemaps',
    'django.contrib.formtools',
    'djangocms_text_ckeditor',  # note this needs to be above the 'cms' entry
    'cms',
    "treebeard",
    'mptt',
    'menus',
    'sekizai',
    'djangocms_admin_style',  # note this needs to be above the 'django.contrib.admin' entry
    'django.contrib.admin',
    'django_mptt_admin',
    'filer',
    'easy_thumbnails',
    'cmsplugin_filer_file',
    'cmsplugin_filer_folder',
    'cmsplugin_filer_link',
    'cmsplugin_filer_image',
    'cmsplugin_filer_video',
    'reversion',
    'password_reset',
    'parler',

)

Patrick Colmant's avatar
Patrick Colmant committed
121 122 123
MIDDLEWARE_CLASSES = (
    'django.middleware.cache.UpdateCacheMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
Patrick Colmant's avatar
Patrick Colmant committed
124
    'django.middleware.common.CommonMiddleware',
Patrick's avatar
Patrick committed
125
    'django.middleware.csrf.CsrfViewMiddleware',
Patrick Colmant's avatar
Patrick Colmant committed
126
    'django.contrib.auth.middleware.AuthenticationMiddleware',
Patrick Colmant's avatar
Patrick Colmant committed
127 128
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.middleware.common.BrokenLinkEmailsMiddleware',
Patrick Colmant's avatar
Patrick Colmant committed
129
    'django.contrib.messages.middleware.MessageMiddleware',
Patrick Colmant's avatar
Patrick Colmant committed
130
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
Patrick Colmant's avatar
Patrick Colmant committed
131 132
    'django.middleware.locale.LocaleMiddleware',
    'django.middleware.doc.XViewMiddleware',
Patrick's avatar
Cleanup  
Patrick committed
133
    'cms.middleware.page.CurrentPageMiddleware',
Patrick Colmant's avatar
Patrick Colmant committed
134
    'cms.middleware.user.CurrentUserMiddleware',
Patrick Colmant's avatar
Patrick Colmant committed
135
    'cms.middleware.toolbar.ToolbarMiddleware',
Patrick Colmant's avatar
Patrick Colmant committed
136
    # 'cms.middleware.language.LanguageCookieMiddleware',
Patrick's avatar
Cleanup  
Patrick committed
137
    'django.middleware.cache.FetchFromCacheMiddleware',
Patrick Colmant's avatar
Patrick Colmant committed
138
)
Patrick Colmant's avatar
Patrick Colmant committed
139 140 141

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.contrib.auth.context_processors.auth',
Patrick Colmant's avatar
Patrick Colmant committed
142
    'django.contrib.messages.context_processors.messages',
Patrick Colmant's avatar
Patrick Colmant committed
143 144 145 146
    'django.core.context_processors.i18n',
    'django.core.context_processors.request',
    'django.core.context_processors.media',
    'django.core.context_processors.static',
Patrick's avatar
Patrick committed
147 148
    'cms.context_processors.cms_settings',
    # 'cms.context_processors.media',
149
    'sekizai.context_processors.sekizai',
Patrick Colmant's avatar
Patrick Colmant committed
150
)
Patrick Colmant's avatar
Patrick Colmant committed
151

Patrick Colmant's avatar
Patrick Colmant committed
152 153 154 155 156
TEMPLATE_LOADERS = (
    ('django.template.loaders.cached.Loader', (
        'django.template.loaders.filesystem.Loader',
        'django.template.loaders.app_directories.Loader',
    )),
157
)
Patrick Colmant's avatar
Patrick Colmant committed
158

Patrick Colmant's avatar
Patrick Colmant committed
159 160 161 162 163 164 165 166 167 168 169 170
MIGRATION_MODULES = {
    'cms': 'cms.migrations_django',
    'menus': 'menus.migrations_django',
    'filer': 'filer.migrations_django',
    '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',
}

171
CMS_PERMISSION = False  # When set to True, don't forget 'cms.middleware.user.CurrentUserMiddleware'
Patrick Colmant's avatar
Patrick Colmant committed
172
CMS_PUBLIC_FOR = 'all'
Patrick Colmant's avatar
Patrick Colmant committed
173
# CMS_PUBLIC_FOR = 'staff'
Patrick Colmant's avatar
Patrick Colmant committed
174 175 176 177 178 179
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
180

Patrick's avatar
Patrick committed
181
CKEDITOR_SETTINGS = {
182
    'language': '{{ language }}',
Patrick Colmant's avatar
Patrick Colmant committed
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
    'toolbar_CMS': [
        ['Undo', 'Redo'],
        ['cmsplugins', '-', 'ShowBlocks'],
        ['Format', 'Templates'],
        ['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'],
        ['Maximize', '']
    ],
    'forcePasteAsPlainText': 'true',
Patrick's avatar
Cleanup  
Patrick committed
202
    'skin': 'moono',
203 204
    # 'stylesSet' : 'my_styles:%sjs/ckeditor-styles.js' % STATIC_URL,
    # 'stylesSet' : [],
Patrick Colmant's avatar
Patrick Colmant committed
205 206
    # 'extraPlugins': 'cmsplugins',
    'format_tags': 'p;h4;h5;blockquote;mutted;success;info;danger;heart;pushpin',
207 208 209 210 211 212 213 214 215 216 217 218 219 220
    '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' : '*(*)',
Patrick Colmant's avatar
Patrick Colmant committed
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
    'removeFormatTags': 'big,code,del,dfn,em,font,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,u,var',
    'basicEntities': False,
    'entities': False,
    'removePlugins': 'elementspath',
}

CKEDITOR_SETTINGS_MODEL2 = {
    'language': '{{ language }}',
    'toolbar_HTMLField': [
        ['Format', 'Bold', 'Italic', 'TextColor', '-', 'NumberedList', 'BulletedList', 'RemoveFormat'],
        ['Preview', 'Cut', 'Copy', 'PasteText', 'Link', '-', 'Undo', 'Redo'],
        ['Maximize', '']
    ],
    'forcePasteAsPlainText': 'true',
    'skin': 'moono',
    'format_tags': 'p;h4;h5',
    'contentsCss': '%sbootstrap/css/bootstrap.css' % STATIC_URL,
    'removeFormatTags': 'big,code,del,dfn,em,font,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,u,var',
    'basicEntities': False,
    'entities': False,
    'removePlugins': 'elementspath',
Patrick's avatar
Patrick committed
242 243
}

Patrick's avatar
Cleanup  
Patrick committed
244
TEXT_ADDITIONAL_TAGS = ('span',)
Patrick Colmant's avatar
Patrick Colmant committed
245 246
TEXT_ADDITIONAL_ATTRIBUTES = ('class',)
TEXT_HTML_SANITIZE = True
Patrick's avatar
Cleanup  
Patrick committed
247 248 249
# TEXT_SAVE_IMAGE_FUNCTION = 'cmsplugin_filer_image.integrations.ckeditor.create_image_plugin'
# TEXT_SAVE_IMAGE_FUNCTION = 'djangocms_text_ckeditor.picture_save.create_picture_plugin'
TEXT_SAVE_IMAGE_FUNCTION = None
Patrick Colmant's avatar
Patrick Colmant committed
250
TEXT_PLUGINS_INTEGRATION = 'buttons'
Patrick Colmant's avatar
Patrick Colmant committed
251 252 253

FILER_ENABLE_LOGGING = False
FILER_IMAGE_USE_ICON = True
Patrick's avatar
Patrick committed
254 255
FILER_ALLOW_REGULAR_USERS_TO_ADD_ROOT_FOLDERS = True
FILER_ENABLE_PERMISSIONS = False
Patrick Colmant's avatar
Patrick Colmant committed
256 257
FILER_IS_PUBLIC_DEFAULT = True
FILER_SUBJECT_LOCATION_IMAGE_DEBUG = True
Patrick Colmant's avatar
Patrick Colmant committed
258
FILER_DEBUG = False
Patrick Colmant's avatar
Patrick Colmant committed
259 260 261 262 263 264 265

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 Colmant's avatar
Patrick Colmant committed
266
)
Patrick Colmant's avatar
Patrick Colmant committed
267 268
THUMBNAIL_HIGH_RESOLUTION = True
THUMBNAIL_DEBUG = FILER_DEBUG
Patrick Colmant's avatar
Patrick Colmant committed
269

270
# https://docs.djangoproject.com/en/1.5/howto/static-files/
Patrick Colmant's avatar
Patrick Colmant committed
271 272 273 274 275 276 277 278 279
STATIC_ROOT = os.path.join(PROJECT_DIR, "collect-static")
STATIC_URL = "/static/"
MEDIA_URL = "/media/"
USE_X_FORWARDED_HOST = True
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
SESSION_ENGINE = "django.contrib.sessions.backends.file"
SESSION_COOKIE_HTTPONLY = True
SESSION_FILE_PATH = '/var/tmp/django_session'
SOUTH_TESTS_MIGRATE = DEBUG
Patrick Colmant's avatar
Patrick Colmant committed
280 281

##################### Repanier
282
AUTH_USER_MODEL = 'auth.User'
Patrick Colmant's avatar
Patrick Colmant committed
283
AUTHENTICATION_BACKENDS = ('repanier.auth_backend.RepanierCustomBackend',)
284 285
# ADMIN_LOGIN = 'pise'
# ADMIN_PASSWORD = 'raspberry'
Patrick Colmant's avatar
Patrick Colmant committed
286
INSTALLED_APPS += (
Patrick Colmant's avatar
Patrick Colmant committed
287
    'repanier',
Patrick Colmant's avatar
Patrick Colmant committed
288
)
Patrick Colmant's avatar
Patrick Colmant committed
289 290 291
LOGIN_URL = "/repanier/go_repanier/"
LOGIN_REDIRECT_URL = "/"
LOGOUT_URL = "/repanier/leave_repanier/"
Patrick Colmant's avatar
Patrick Colmant committed
292

Patrick Colmant's avatar
Patrick Colmant committed
293
################# Django_crispy_forms
Patrick Colmant's avatar
Patrick Colmant committed
294 295 296 297
INSTALLED_APPS += (
    'crispy_forms',
    # 'crispy_forms_foundation',
)
Patrick Colmant's avatar
Patrick Colmant committed
298

Patrick Colmant's avatar
Patrick Colmant committed
299 300
CRISPY_TEMPLATE_PACK = "bootstrap3"
# # CRISPY_TEMPLATE_PACK = "foundation"
Patrick's avatar
Cleanup  
Patrick committed
301
# JSON_MODULE = 'ujson'
Patrick Colmant's avatar
Patrick Colmant committed
302

Patrick Colmant's avatar
Patrick Colmant committed
303 304 305
################# Django_compressor
INSTALLED_APPS += (
    'compressor',
Patrick Colmant's avatar
Patrick Colmant committed
306
)
Patrick Colmant's avatar
Patrick Colmant committed
307 308 309 310
##### From : django/conf/global_settings.py
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
311
    #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
Patrick Colmant's avatar
Patrick Colmant committed
312 313
)

Patrick Colmant's avatar
Patrick Colmant committed
314
STATICFILES_FINDERS += (
315
    'compressor.finders.CompressorFinder',
Patrick Colmant's avatar
Patrick Colmant committed
316 317
)

Patrick Colmant's avatar
Patrick Colmant committed
318 319 320 321 322 323
COMPRESS_ENABLED = True
COMPRESS_OUTPUT_DIR = "compressor"
COMPRESS_STORAGE = 'compressor.storage.GzipCompressorFileStorage'
COMPRESS_PARSER = "compressor.parser.HtmlParser"
COMPRESS_OFFLINE = False

324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347
# COMPRESS_YUI_BINARY = "yui-compressor"
# COMPRESS_CLOSURE_COMPILER_BINARY = "/usr/local/bin/node /usr/local/bin/uglifyjs"
# COMPRESS_CLOSURE_COMPILER_ARGUMENTS = '--compress'

# COMPRESS_CSS_FILTERS = [
#    'compressor.filters.yui.YUICSSFilter',
#    'compressor.filters.css_default.CssAbsoluteFilter',
#    'compressor.filters.template.TemplateFilter'
#    ]

# COMPRESS_JS_FILTERS = [
#    'compressor.filters.yui.YUIJSFilter',
#     'compressor.filters.closure.ClosureCompilerFilter',
#    'compressor.filters.jsmin.JSMinFilter',
#    'compressor.filters.template.TemplateFilter'
#    ]

# COMPRESS_PRECOMPILERS = (
#    ('text/coffeescript', 'coffee --compile --stdio'),
#    ('text/less', 'lessc {infile} {outfile}'),
#    ('text/x-sass', 'sass {infile} {outfile}'),
#    ('text/x-scss', 'sass --scss {infile} {outfile}'),
#    ('text/stylus', 'stylus < {infile} > {outfile}'),
# )
Patrick Colmant's avatar
Patrick Colmant committed
348 349 350 351

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

CACHE_MIDDLEWARE_ALIAS = 'default'
Patrick's avatar
Patrick committed
352
CACHE_MIDDLEWARE_SECONDS = 3600
Patrick Colmant's avatar
Patrick Colmant committed
353

Patrick Colmant's avatar
Patrick Colmant committed
354 355 356 357 358 359 360 361 362 363 364
# CACHES = {
#     'default': {
#         'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
#         'LOCATION': '/var/tmp/django_cache',
#         'TIMEOUT': 300,
#         'OPTIONS': {
#             'MAX_ENTRIES': 1000,
#             'CULL_FREQUENCY': 3
#         }
#     }
# }
Patrick Colmant's avatar
Patrick Colmant committed
365 366

CMS_CACHE_DURATIONS = {
367 368 369 370 371
    'content': 300,  # default 60
    'menus': 3600,  # default 3600
    'permissions': 3600  # default: 3600
}

Patrick Colmant's avatar
Patrick Colmant committed
372 373 374
# SOUTH_MIGRATION_MODULES = {
#     'easy_thumbnails': 'easy_thumbnails.south_migrations',
# }
375 376 377
###################### EASYMAP
#EASY_MAPS_CENTER = ( 50.630545,3.776955 )

Patrick Colmant's avatar
Patrick Colmant committed
378 379 380 381 382
##################### DECIMAL
from decimal import getcontext, ROUND_HALF_UP

getcontext().rounding = ROUND_HALF_UP

383 384 385 386 387
#INSTALLED_APPS += (
#    'easy_maps',
#)


Patrick's avatar
Patrick committed
388 389 390 391 392
# if DEBUG:
#     import logging
#     l = logging.getLogger('django.db.backends')
#     l.setLevel(logging.DEBUG)
#     l.addHandler(logging.StreamHandler())
Patrick Colmant's avatar
Patrick Colmant committed
393 394
#
#
Patrick's avatar
Patrick committed
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423
# 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'
#         },'console': {
#             'level': 'DEBUG',
#             'class': 'logging.StreamHandler',
#         },
#     },
#     'loggers': {
#         'django.request': {
#             'handlers': ['mail_admins'],
#             'level': 'ERROR',
#             'propagate': True,
#         },'django.db.backends': {
#             'level': 'DEBUG',
#             'handlers': ['console'],
#         },
#     }
# }