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