raven
[auf_savoirs_en_partage_django.git] / auf_savoirs_en_partage / settings.py
CommitLineData
6525d9ce 1# -*- encoding: utf-8 -*-
155a7c62
CR
2
3import os
31249cf3
EMS
4from conf import * # NOQA
5
6PROJECT_HOME = os.path.dirname(__file__)
7HOME = os.path.dirname(PROJECT_HOME)
155a7c62 8
ddf3b479
OL
9ADMINS = ()
10
11LOGGING = {
12 'version': 1,
13 'disable_existing_loggers': True,
14 'root': {
15 'level': 'WARNING',
16 'handlers': ['sentry'],
17 },
18 'formatters': {
19 'verbose': {
20 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
21 },
22 },
23 'handlers': {
24 'sentry': {
25 'level': 'WARNING',
26 'class': 'raven.contrib.django.handlers.SentryHandler',
27 },
28 'console': {
29 'level': 'DEBUG',
30 'class': 'logging.StreamHandler',
31 'formatter': 'verbose'
32 }
33 },
34 'loggers': {
35 'django.db.backends': {
36 'level': 'ERROR',
37 'handlers': ['console'],
38 'propagate': False,
39 },
40 'raven': {
41 'level': 'DEBUG',
42 'handlers': ['console'],
43 'propagate': False,
44 },
45 'sentry.errors': {
46 'level': 'DEBUG',
47 'handlers': ['console'],
48 'propagate': False,
49 },
50 },
51}
155a7c62 52
8cda4c7d
PP
53ADMINS_SEP = ('gilles.deggis@auf.org',)
54
155a7c62
CR
55MANAGERS = ADMINS
56
31249cf3 57TIME_ZONE = 'America/Montreal'
155a7c62 58
d15017b2 59LANGUAGE_CODE = 'fr-ca'
155a7c62
CR
60
61# Absolute path to the directory that holds media.
62# Example: "/home/media/media.lawrence.com/"
31249cf3 63MEDIA_ROOT = os.path.join(PROJECT_HOME, 'media')
155a7c62
CR
64
65# URL that handles the media served from MEDIA_ROOT. Make sure to use a
66# trailing slash if there is a path component (optional in other cases).
67# Examples: "http://media.lawrence.com", "http://example.com/media/"
68MEDIA_URL = '/media/'
69
7a355faa
AJ
70# List of callables that know how to import templates from various sources.
71TEMPLATE_LOADERS = (
72 'django.template.loaders.filesystem.load_template_source',
73 'django.template.loaders.app_directories.load_template_source',
74# 'django.template.loaders.eggs.load_template_source',
75)
76
155a7c62 77MIDDLEWARE_CLASSES = (
1629c43d 78 'django.middleware.cache.UpdateCacheMiddleware',
8a335360 79 'django.middleware.gzip.GZipMiddleware',
155a7c62
CR
80 'django.middleware.common.CommonMiddleware',
81 'django.contrib.sessions.middleware.SessionMiddleware',
82 'django.contrib.auth.middleware.AuthenticationMiddleware',
aac1254a 83 'django.contrib.messages.middleware.MessageMiddleware',
1629c43d 84 'django.middleware.cache.FetchFromCacheMiddleware',
518d0b44 85 'chercheurs.middleware.ChercheurMiddleware',
9f1770cf 86 'djangoflash.middleware.FlashMiddleware',
7a355faa 87 'pagination.middleware.PaginationMiddleware',
155a7c62
CR
88 'django.middleware.doc.XViewMiddleware',
89)
90
0cc5f772 91ROOT_URLCONF = 'auf_savoirs_en_partage.urls'
155a7c62 92
155a7c62 93INSTALLED_APPS = (
6d885e0c 94 'admin_tools',
95 'admin_tools.theming',
96 'admin_tools.menu',
97 'admin_tools.dashboard',
aac1254a 98 'django.contrib.admin',
155a7c62
CR
99 'django.contrib.auth',
100 'django.contrib.contenttypes',
aac1254a 101 'django.contrib.messages',
155a7c62 102 'django.contrib.sessions',
31249cf3 103 'django.contrib.staticfiles',
7a355faa 104 'pagination',
6ef8ead4 105 'django_roa',
d15017b2 106 'savoirs',
932eef9a 107 'chercheurs',
bab65667 108 'sitotheque',
5212238e 109 'djangosphinx',
f78371b2 110 'south',
ddf3b479 111 'raven.contrib.django',
f78371b2 112 'auf.django.admingroup',
693c606b 113 'auf.django.references',
b1d4c7ac 114 'alphafilter',
933268d6 115 'interfaces',
c4312cce 116 'rappels',
693c606b 117 'pytz',
155a7c62
CR
118)
119
9af73c99 120TEMPLATE_CONTEXT_PROCESSORS = (
31249cf3 121 "django.contrib.auth.context_processors.auth",
9af73c99
AJ
122 "django.core.context_processors.debug",
123 "django.core.context_processors.i18n",
124 "django.core.context_processors.media",
125 "django.core.context_processors.request",
bae03b7b 126 "context_processors.discipline_region",
aac1254a
EMS
127 "djangoflash.context_processors.flash",
128 'django.contrib.messages.context_processors.messages',
9af73c99 129)
bae03b7b 130
155a7c62 131TEMPLATE_LOADERS = (
31249cf3
EMS
132 'django.template.loaders.filesystem.Loader',
133 'django.template.loaders.app_directories.Loader',
155a7c62
CR
134)
135
136TEMPLATE_DIRS = (
31249cf3 137 os.path.join(PROJECT_HOME, "templates"),
155a7c62
CR
138)
139
695930dd 140AUTHENTICATION_BACKENDS = (
31249cf3 141 'auf.django.auth.backends.CascadeBackend',
695930dd
EMS
142 'authentification.PersonneBackend',
143 'django.contrib.auth.backends.ModelBackend',
144)
f1df3ff6
EMS
145AUTH_PROFILE_MODULE = 'savoirs.Profile'
146
f67f66aa 147LOGIN_URL = '/chercheurs/connexion/'
518d0b44 148LOGIN_REDIRECT_URL = '/chercheurs/perso/'
5fa0c5a4 149
31249cf3
EMS
150CACHES = {
151 'default': {
152 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
153 'LOCATION': 'localhost:11211'
154 }
155}
6525d9ce 156
31249cf3
EMS
157ADMIN_TOOLS_INDEX_DASHBOARD = \
158 'auf_savoirs_en_partage.dashboard.CustomIndexDashboard'
9c29b8d4 159ADMIN_TOOLS_MENU = 'auf_savoirs_en_partage.menu.CustomMenu'
6d885e0c 160
0e9597af
AJ
161CONTACT_EMAIL = 'contact-savoirsenpartage@auf.org'
162
31249cf3
EMS
163LOCALE_PATHS = (
164 os.path.join(PROJECT_HOME, 'locale'),
165)
166
167# djangosphinx
168
5212238e
EMS
169SPHINX_API_VERSION = 0x116
170SPHINX_PORT = 9312
171
31249cf3
EMS
172# django.contrib.staticfiles
173
174STATICFILES_DIRS = (
175 os.path.join(PROJECT_HOME, 'static'),
176)
177STATIC_URL = '/static/'
178STATIC_ROOT = os.path.join(HOME, 'sitestatic')
179STATICFILES_FINDERS = (
180 'django.contrib.staticfiles.finders.FileSystemFinder',
181 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
31249cf3 182)
fcda8bb5
EMS
183STATICFILES_STORAGE = \
184 'django.contrib.staticfiles.storage.CachedStaticFilesStorage'