raven
[auf_savoirs_en_partage_django.git] / auf_savoirs_en_partage / settings.py
1 # -*- encoding: utf-8 -*-
2
3 import os
4 from conf import * # NOQA
5
6 PROJECT_HOME = os.path.dirname(__file__)
7 HOME = os.path.dirname(PROJECT_HOME)
8
9 ADMINS = ()
10
11 LOGGING = {
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 }
52
53 ADMINS_SEP = ('gilles.deggis@auf.org',)
54
55 MANAGERS = ADMINS
56
57 TIME_ZONE = 'America/Montreal'
58
59 LANGUAGE_CODE = 'fr-ca'
60
61 # Absolute path to the directory that holds media.
62 # Example: "/home/media/media.lawrence.com/"
63 MEDIA_ROOT = os.path.join(PROJECT_HOME, 'media')
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/"
68 MEDIA_URL = '/media/'
69
70 # List of callables that know how to import templates from various sources.
71 TEMPLATE_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
77 MIDDLEWARE_CLASSES = (
78 'django.middleware.cache.UpdateCacheMiddleware',
79 'django.middleware.gzip.GZipMiddleware',
80 'django.middleware.common.CommonMiddleware',
81 'django.contrib.sessions.middleware.SessionMiddleware',
82 'django.contrib.auth.middleware.AuthenticationMiddleware',
83 'django.contrib.messages.middleware.MessageMiddleware',
84 'django.middleware.cache.FetchFromCacheMiddleware',
85 'chercheurs.middleware.ChercheurMiddleware',
86 'djangoflash.middleware.FlashMiddleware',
87 'pagination.middleware.PaginationMiddleware',
88 'django.middleware.doc.XViewMiddleware',
89 )
90
91 ROOT_URLCONF = 'auf_savoirs_en_partage.urls'
92
93 INSTALLED_APPS = (
94 'admin_tools',
95 'admin_tools.theming',
96 'admin_tools.menu',
97 'admin_tools.dashboard',
98 'django.contrib.admin',
99 'django.contrib.auth',
100 'django.contrib.contenttypes',
101 'django.contrib.messages',
102 'django.contrib.sessions',
103 'django.contrib.staticfiles',
104 'pagination',
105 'django_roa',
106 'savoirs',
107 'chercheurs',
108 'sitotheque',
109 'djangosphinx',
110 'south',
111 'raven.contrib.django',
112 'auf.django.admingroup',
113 'auf.django.references',
114 'alphafilter',
115 'interfaces',
116 'rappels',
117 'pytz',
118 )
119
120 TEMPLATE_CONTEXT_PROCESSORS = (
121 "django.contrib.auth.context_processors.auth",
122 "django.core.context_processors.debug",
123 "django.core.context_processors.i18n",
124 "django.core.context_processors.media",
125 "django.core.context_processors.request",
126 "context_processors.discipline_region",
127 "djangoflash.context_processors.flash",
128 'django.contrib.messages.context_processors.messages',
129 )
130
131 TEMPLATE_LOADERS = (
132 'django.template.loaders.filesystem.Loader',
133 'django.template.loaders.app_directories.Loader',
134 )
135
136 TEMPLATE_DIRS = (
137 os.path.join(PROJECT_HOME, "templates"),
138 )
139
140 AUTHENTICATION_BACKENDS = (
141 'auf.django.auth.backends.CascadeBackend',
142 'authentification.PersonneBackend',
143 'django.contrib.auth.backends.ModelBackend',
144 )
145 AUTH_PROFILE_MODULE = 'savoirs.Profile'
146
147 LOGIN_URL = '/chercheurs/connexion/'
148 LOGIN_REDIRECT_URL = '/chercheurs/perso/'
149
150 CACHES = {
151 'default': {
152 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
153 'LOCATION': 'localhost:11211'
154 }
155 }
156
157 ADMIN_TOOLS_INDEX_DASHBOARD = \
158 'auf_savoirs_en_partage.dashboard.CustomIndexDashboard'
159 ADMIN_TOOLS_MENU = 'auf_savoirs_en_partage.menu.CustomMenu'
160
161 CONTACT_EMAIL = 'contact-savoirsenpartage@auf.org'
162
163 LOCALE_PATHS = (
164 os.path.join(PROJECT_HOME, 'locale'),
165 )
166
167 # djangosphinx
168
169 SPHINX_API_VERSION = 0x116
170 SPHINX_PORT = 9312
171
172 # django.contrib.staticfiles
173
174 STATICFILES_DIRS = (
175 os.path.join(PROJECT_HOME, 'static'),
176 )
177 STATIC_URL = '/static/'
178 STATIC_ROOT = os.path.join(HOME, 'sitestatic')
179 STATICFILES_FINDERS = (
180 'django.contrib.staticfiles.finders.FileSystemFinder',
181 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
182 )
183 STATICFILES_STORAGE = \
184 'django.contrib.staticfiles.storage.CachedStaticFilesStorage'