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