sentry #196 calcul auto, silence si couple invlide
[auf_rh_dae.git] / project / settings.py
CommitLineData
5e23d90d
OL
1# -*- encoding: utf-8 -*-
2
3import os
4import socket
294866db 5from project.conf import * # NOQA
75f0e87b 6
a16928b9 7PROJET_TITRE = "Ressources humaines"
3a2f12b2 8
5e23d90d 9# Rapports d'erreurs
80b95abf 10SERVER_EMAIL = 'ne-pas-repondre@auf.org'
5e23d90d 11EMAIL_SUBJECT_PREFIX = '[auf_rh_dae - %s] ' % socket.gethostname()
a6197482 12ADMINS = ()
5e23d90d
OL
13
14MANAGERS = ADMINS
15
1ea6b6e6 16TIME_ZONE = 'America/Montreal'
21b8a2de
EMS
17LANGUAGE_CODE = 'fr'
18FORMAT_MODULE_PATH = 'project.formats'
19USE_L10N = True
af87da19 20USE_THOUSAND_SEPARATOR = False
a25e1d5c 21DATE_FORMAT = 'd-m-Y'
5e8b78d9 22DATE_INPUT_FORMATS = ('%d-%m-%Y', )
a25e1d5c 23
920f297c
JPC
24SESSION_SAVE_EVERY_REQUEST = True
25SESSION_EXPIRE_AT_BROWSER_CLOSE = True
26
b1b7cca2
OL
27PROJECT_ROOT = os.path.dirname(__file__)
28SITE_ROOT = os.path.dirname(PROJECT_ROOT)
29
5e23d90d
OL
30# Absolute path to the directory that holds media.
31# Example: "/home/media/media.lawrence.com/"
b1b7cca2
OL
32MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media')
33PRIVE_MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media_prive')
5e23d90d 34
63f8af95 35STATICFILES_DIRS = (
b1b7cca2 36 os.path.join(PROJECT_ROOT, 'assets'),
63f8af95 37)
b1b7cca2 38STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')
63f8af95
OL
39STATIC_URL = '/static/'
40
5e23d90d
OL
41# URL that handles the media served from MEDIA_ROOT. Make sure to use a
42# trailing slash if there is a path component (optional in other cases).
43# Examples: "http://media.lawrence.com", "http://example.com/media/"
44MEDIA_URL = '/media/'
5be60939 45PRIVE_MEDIA_URL = '/prive/'
7f25c8a6 46OE_PRIVE_MEDIA_URL = '/recrutement/prive/'
36341125 47
5e23d90d
OL
48# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
49# trailing slash.
50# Examples: "http://foo.com/media/", "/media/".
63f8af95 51#ADMIN_MEDIA_PREFIX = '/media/django/'
5e23d90d
OL
52
53# Don't share this with anybody.
54SECRET_KEY = '^2w#%abp_d+e#(7f5w$leef50)c@4y38cnn#ccji@84$2^rt#l'
55
56MIDDLEWARE_CLASSES = (
57 'django.middleware.common.CommonMiddleware',
58 'django.contrib.sessions.middleware.SessionMiddleware',
9cb4de55 59 'django.contrib.messages.middleware.MessageMiddleware',
5e23d90d 60 'django.contrib.auth.middleware.AuthenticationMiddleware',
b1b7cca2 61 'auf.django.saml.middleware.SPMiddleware',
45ab9f14 62 'auf.django.piwik.middleware.TrackMiddleware',
5e23d90d 63 'django.middleware.doc.XViewMiddleware',
17353922 64 'reversion.middleware.RevisionMiddleware',
5e23d90d
OL
65)
66
67ROOT_URLCONF = 'project.urls'
68
5e23d90d
OL
69INSTALLED_APPS = (
70 'auf.django.skin',
bf6f2712 71 'auf.django.references',
0c104342
DB
72 'auf.django.emploi',
73 'auf.django.admingroup',
74 'auf.django.workflow',
75 'auf.django.permissions',
76 'auf.django.emploi',
b1b7cca2 77 'auf.django.saml',
bdbc1f13 78 'auf.django.export',
5e23d90d
OL
79 'admin_tools',
80 'admin_tools.theming',
81 'admin_tools.menu',
82 'admin_tools.dashboard',
fc62be5d 83 'django.contrib.admin',
5e23d90d
OL
84 'django.contrib.auth',
85 'django.contrib.contenttypes',
fc62be5d 86 'django.contrib.humanize',
9cb4de55 87 'django.contrib.messages',
5e23d90d 88 'django.contrib.sessions',
63f8af95 89 'django.contrib.staticfiles',
a194e017 90 'django_qbe',
3121c13c 91 'ajax_select',
5e23d90d 92 'south',
debe5209 93 'raven.contrib.django',
17353922 94 'reversion',
7ffc5aa4 95 'alphafilter',
8ea41642 96 'form_utils',
ec517164 97 'tinymce',
86caaf03 98 'captcha',
0c104342
DB
99 'project.rh',
100 'project.dae',
101 'project.recrutement',
5e23d90d
OL
102)
103
104TEMPLATE_CONTEXT_PROCESSORS = (
4229d916 105 'django.contrib.auth.context_processors.auth',
5e23d90d
OL
106 'django.core.context_processors.debug',
107 'django.core.context_processors.i18n',
108 'django.core.context_processors.media',
63f8af95 109 'django.core.context_processors.static',
5e23d90d
OL
110 'django.contrib.messages.context_processors.messages',
111 'django.core.context_processors.request',
112 'auf.django.skin.context_processors.auf',
ef71b858 113 'project.dae.context_processors.user_in_dae_groupes',
5e23d90d
OL
114)
115
8846b99e 116AUTHENTICATION_BACKENDS = (
b1b7cca2 117 'auf.django.saml.backends.SPBackend',
c3f0b49f 118 'auf.django.permissions.backends.AuthenticationBackend',
8846b99e 119)
5e23d90d 120
5e23d90d
OL
121TEMPLATE_DIRS = (
122 os.path.join(os.path.dirname(__file__), "templates"),
123)
124
125
8846b99e 126ADMIN_TOOLS_INDEX_DASHBOARD = 'project.dashboard.CustomIndexDashboard'
7f43054e 127ADMIN_TOOLS_APP_INDEX_DASHBOARD = 'project.dashboard.CustomAppIndexDashboard'
6f38ca31 128ADMIN_TOOLS_MENU = 'project.menu.CustomMenu'
3121c13c
OL
129
130AJAX_LOOKUP_CHANNELS = {
294866db
EMS
131 'responsables': ('project.dae.catalogues', 'Responsable'),
132 'dossiers': ('project.dae.catalogues', 'Dossier'),
133 'dae_postes': ('project.dae.catalogues', 'Poste'),
134 'pays': ('project.rh.catalogues', 'Pays'),
135 'implantations': ('project.rh.catalogues', 'Implantation'),
136 'typepostes': ('project.rh.catalogues', 'TypePoste'),
137 'postes': ('project.rh.catalogues', 'Poste'),
138 'valeurpoints': ('project.rh.catalogues', 'ValeurPoint'),
139 'employes': ('project.rh.catalogues', 'Employe'),
140 'dossiers': ('project.rh.catalogues', 'Dossier'),
3121c13c 141}
105dd778
OL
142AJAX_SELECT_INLINES = 'inline'
143
8ea41642 144
ec517164 145TINYMCE_DEFAULT_CONFIG = {
294866db
EMS
146 'theme': "advanced",
147 'plugins': "paste",
148 'theme_advanced_buttons1': (
149 "bold,italic,underline,|,formatselect,|,bullist,numlist,|,undo,redo,|,"
150 "link,unlink"
151 ),
152 'theme_advanced_buttons2': "",
153 'theme_advanced_buttons3': "",
154 'theme_advanced_statusbar_location': "bottom",
155 'theme_advanced_toolbar_align': "left",
156 'theme_advanced_styles': "Titre=titre;Sous-titre=sous-titre;Normal=normal",
157 'width': "800",
158 'height': "200",
159 'theme_advanced_resizing': "true",
160 'custom_undo_redo_levels': 10,
161 'theme_advanced_toolbar_location': 'top',
162 'inline_styles': 'false',
163 'paste_use_dialog': 'false',
164 'paste_auto_cleanup_on_paste': 'true',
165 'paste_convert_headers_to_strong': 'false',
166 'paste_strip_class_attributes': 'all',
167 'paste_remove_spans': 'true',
168 'paste_remove_styles': 'true',
169 'content_css': '/media/css/tinymce.css',
ec517164 170}
34dad720
EMS
171
172# django-sendfile
34dad720 173SENDFILE_BACKEND = 'sendfile.backends.simple'
361d53e1
PP
174
175QBE_DISPLAY_DATABASES = False
ddf236b3
PP
176
177# Il est *très* important de respecter la case.
178QBE_CUSTOM_MODELS = {'Rh': {
179 'Employe': {},
180 'Poste': {},
181 'Dossier': {},
182 'Remuneration': {},
183 'Contrat': {},
184}}
972e7cf1
PP
185
186QBE_ALLOWED_FIELDS = {'Rh': {
294866db
EMS
187 'Employe': [
188 'nom', 'prenom', 'genre', 'date_naissance', 'situation_familiale',
189 'date_entree'
190 ],
972e7cf1 191 'Poste': ['nom', 'date_debut', 'date_fin'],
294866db
EMS
192 'Dossier': [
193 'statut_residence', 'regime_travail',
194 'regime_travail_nb_heure_semaine', 'date_debut', 'date_fin'
195 ],
972e7cf1
PP
196 'Remuneration': ['montant', 'date_debut', 'date_fin'],
197 'Contrat': ['date_debut', 'date_fin'],
198}}
82c5e37d 199
d7bf0cd3 200SOUTH_TESTS_MIGRATE = False
a6197482
OL
201
202LOGGING = {
203 'version': 1,
204 'disable_existing_loggers': True,
205 'root': {
206 'level': 'WARNING',
207 'handlers': ['sentry'],
208 },
209 'formatters': {
210 'verbose': {
211 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
212 },
213 },
214 'handlers': {
215 'sentry': {
216 'level': 'WARNING',
217 'class': 'raven.contrib.django.handlers.SentryHandler',
218 },
219 'console': {
220 'level': 'DEBUG',
221 'class': 'logging.StreamHandler',
222 'formatter': 'verbose'
223 }
224 },
225 'loggers': {
226 'django.db.backends': {
227 'level': 'ERROR',
228 'handlers': ['console'],
229 'propagate': False,
230 },
231 'raven': {
232 'level': 'DEBUG',
233 'handlers': ['console'],
234 'propagate': False,
235 },
236 'sentry.errors': {
237 'level': 'DEBUG',
238 'handlers': ['console'],
239 'propagate': False,
240 },
241 },
242}