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