pong
[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 'auf.django.pong',
116 'alphafilter',
117 'interfaces',
118 'rappels',
119 'pytz',
120 )
121
122 TEMPLATE_CONTEXT_PROCESSORS = (
123 "django.contrib.auth.context_processors.auth",
124 "django.core.context_processors.debug",
125 "django.core.context_processors.i18n",
126 "django.core.context_processors.media",
127 "django.core.context_processors.request",
128 "context_processors.discipline_region",
129 "djangoflash.context_processors.flash",
130 'django.contrib.messages.context_processors.messages',
131 )
132
133 TEMPLATE_LOADERS = (
134 'django.template.loaders.filesystem.Loader',
135 'django.template.loaders.app_directories.Loader',
136 )
137
138 TEMPLATE_DIRS = (
139 os.path.join(PROJECT_HOME, "templates"),
140 )
141
142 AUTHENTICATION_BACKENDS = (
143 'auf.django.auth.backends.CascadeBackend',
144 'authentification.PersonneBackend',
145 'django.contrib.auth.backends.ModelBackend',
146 )
147 AUTH_PROFILE_MODULE = 'savoirs.Profile'
148
149 LOGIN_URL = '/chercheurs/connexion/'
150 LOGIN_REDIRECT_URL = '/chercheurs/perso/'
151
152 CACHES = {
153 'default': {
154 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
155 'LOCATION': 'localhost:11211'
156 }
157 }
158
159 ADMIN_TOOLS_INDEX_DASHBOARD = \
160 'auf_savoirs_en_partage.dashboard.CustomIndexDashboard'
161 ADMIN_TOOLS_MENU = 'auf_savoirs_en_partage.menu.CustomMenu'
162
163 CONTACT_EMAIL = 'contact-savoirsenpartage@auf.org'
164
165 LOCALE_PATHS = (
166 os.path.join(PROJECT_HOME, 'locale'),
167 )
168
169 SOUTH_TESTS_MIGRATE = False
170
171 # djangosphinx
172
173 SPHINX_API_VERSION = 0x116
174 SPHINX_PORT = 9312
175
176 # django.contrib.staticfiles
177
178 STATICFILES_DIRS = (
179 os.path.join(PROJECT_HOME, 'static'),
180 )
181 STATIC_URL = '/static/'
182 STATIC_ROOT = os.path.join(HOME, 'sitestatic')
183 STATICFILES_FINDERS = (
184 'django.contrib.staticfiles.finders.FileSystemFinder',
185 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
186 )
187 STATICFILES_STORAGE = \
188 'django.contrib.staticfiles.storage.CachedStaticFilesStorage'