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