hotfix : breach attack django
[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 'auf.django.piwik.middleware.TrackMiddleware',
84 'django.contrib.messages.middleware.MessageMiddleware',
85 'django.middleware.cache.FetchFromCacheMiddleware',
86 'chercheurs.middleware.ChercheurMiddleware',
87 'djangoflash.middleware.FlashMiddleware',
88 'pagination.middleware.PaginationMiddleware',
89 'django.middleware.doc.XViewMiddleware',
90 )
91
92 ROOT_URLCONF = 'auf_savoirs_en_partage.urls'
93
94 INSTALLED_APPS = (
95 'admin_tools',
96 'admin_tools.theming',
97 'admin_tools.menu',
98 'admin_tools.dashboard',
99 'django.contrib.admin',
100 'django.contrib.auth',
101 'django.contrib.contenttypes',
102 'django.contrib.messages',
103 'django.contrib.sessions',
104 'django.contrib.staticfiles',
105 'pagination',
106 'django_roa',
107 'savoirs',
108 'chercheurs',
109 'sitotheque',
110 'djangosphinx',
111 'south',
112 'raven.contrib.django',
113 'auf.django.admingroup',
114 'auf.django.references',
115 'alphafilter',
116 'interfaces',
117 'rappels',
118 'pytz',
119 )
120
121 TEMPLATE_CONTEXT_PROCESSORS = (
122 "django.contrib.auth.context_processors.auth",
123 "django.core.context_processors.debug",
124 "django.core.context_processors.i18n",
125 "django.core.context_processors.media",
126 "django.core.context_processors.request",
127 "context_processors.discipline_region",
128 "djangoflash.context_processors.flash",
129 'django.contrib.messages.context_processors.messages',
130 )
131
132 TEMPLATE_LOADERS = (
133 'django.template.loaders.filesystem.Loader',
134 'django.template.loaders.app_directories.Loader',
135 )
136
137 TEMPLATE_DIRS = (
138 os.path.join(PROJECT_HOME, "templates"),
139 )
140
141 AUTHENTICATION_BACKENDS = (
142 'auf.django.auth.backends.CascadeBackend',
143 'authentification.PersonneBackend',
144 'django.contrib.auth.backends.ModelBackend',
145 )
146 AUTH_PROFILE_MODULE = 'savoirs.Profile'
147
148 LOGIN_URL = '/chercheurs/connexion/'
149 LOGIN_REDIRECT_URL = '/chercheurs/perso/'
150
151 CACHES = {
152 'default': {
153 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
154 'LOCATION': 'localhost:11211'
155 }
156 }
157
158 ADMIN_TOOLS_INDEX_DASHBOARD = \
159 'auf_savoirs_en_partage.dashboard.CustomIndexDashboard'
160 ADMIN_TOOLS_MENU = 'auf_savoirs_en_partage.menu.CustomMenu'
161
162 CONTACT_EMAIL = 'contact-savoirsenpartage@auf.org'
163
164 LOCALE_PATHS = (
165 os.path.join(PROJECT_HOME, 'locale'),
166 )
167
168 # djangosphinx
169
170 SPHINX_API_VERSION = 0x116
171 SPHINX_PORT = 9312
172
173 # django.contrib.staticfiles
174
175 STATICFILES_DIRS = (
176 os.path.join(PROJECT_HOME, 'static'),
177 )
178 STATIC_URL = '/static/'
179 STATIC_ROOT = os.path.join(HOME, 'sitestatic')
180 STATICFILES_FINDERS = (
181 'django.contrib.staticfiles.finders.FileSystemFinder',
182 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
183 )
184 STATICFILES_STORAGE = \
185 'django.contrib.staticfiles.storage.CachedStaticFilesStorage'