fix app name
[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 'django.middleware.doc.XViewMiddleware',
59 'reversion.middleware.RevisionMiddleware',
60 )
61
62 ROOT_URLCONF = 'project.urls'
63
64 INSTALLED_APPS = (
65 'auf.django.skin',
66 'auf.django.references',
67 'auf.django.emploi',
68 'auf.django.admingroup',
69 'auf.django.workflow',
70 'auf.django.permissions',
71 'auf.django.emploi',
72 'admin_tools',
73 'admin_tools.theming',
74 'admin_tools.menu',
75 'admin_tools.dashboard',
76 'django.contrib.admin',
77 'django.contrib.auth',
78 'django.contrib.contenttypes',
79 'django.contrib.humanize',
80 'django.contrib.messages',
81 'django.contrib.sessions',
82 'django.contrib.staticfiles',
83 'django_qbe',
84 'ajax_select',
85 'south',
86 'raven.contrib.django',
87 'reversion',
88 'alphafilter',
89 'form_utils',
90 'tinymce',
91 'captcha',
92 'project.rh',
93 'project.dae',
94 'project.recrutement',
95 )
96
97 TEMPLATE_CONTEXT_PROCESSORS = (
98 'django.contrib.auth.context_processors.auth',
99 'django.core.context_processors.debug',
100 'django.core.context_processors.i18n',
101 'django.core.context_processors.media',
102 'django.core.context_processors.static',
103 'django.contrib.messages.context_processors.messages',
104 'django.core.context_processors.request',
105 'auf.django.skin.context_processors.auf',
106 'project.dae.context_processors.user_in_dae_groupes',
107 )
108
109 AUTHENTICATION_BACKENDS = (
110 'auf.django.auth.backends.CascadeBackend',
111 'auf.django.permissions.backends.AuthenticationBackend',
112 )
113 LOGIN_URL = "/connexion"
114 LOGIN_REDIRECT_URL = "/"
115
116 TEMPLATE_DIRS = (
117 os.path.join(os.path.dirname(__file__), "templates"),
118 )
119
120
121 ADMIN_TOOLS_INDEX_DASHBOARD = 'project.dashboard.CustomIndexDashboard'
122 ADMIN_TOOLS_APP_INDEX_DASHBOARD = 'project.dashboard.CustomAppIndexDashboard'
123 ADMIN_TOOLS_MENU = 'project.menu.CustomMenu'
124
125 AJAX_LOOKUP_CHANNELS = {
126 'responsables': ('project.dae.catalogues', 'Responsable'),
127 'dossiers': ('project.dae.catalogues', 'Dossier'),
128 'dae_postes': ('project.dae.catalogues', 'Poste'),
129 'pays': ('project.rh.catalogues', 'Pays'),
130 'implantations': ('project.rh.catalogues', 'Implantation'),
131 'typepostes': ('project.rh.catalogues', 'TypePoste'),
132 'postes': ('project.rh.catalogues', 'Poste'),
133 'valeurpoints': ('project.rh.catalogues', 'ValeurPoint'),
134 'employes': ('project.rh.catalogues', 'Employe'),
135 'dossiers': ('project.rh.catalogues', 'Dossier'),
136 }
137 AJAX_SELECT_INLINES = 'inline'
138
139
140 TINYMCE_DEFAULT_CONFIG = {
141 'theme': "advanced",
142 'plugins': "paste",
143 'theme_advanced_buttons1': (
144 "bold,italic,underline,|,formatselect,|,bullist,numlist,|,undo,redo,|,"
145 "link,unlink"
146 ),
147 'theme_advanced_buttons2': "",
148 'theme_advanced_buttons3': "",
149 'theme_advanced_statusbar_location': "bottom",
150 'theme_advanced_toolbar_align': "left",
151 'theme_advanced_styles': "Titre=titre;Sous-titre=sous-titre;Normal=normal",
152 'width': "800",
153 'height': "200",
154 'theme_advanced_resizing': "true",
155 'custom_undo_redo_levels': 10,
156 'theme_advanced_toolbar_location': 'top',
157 'inline_styles': 'false',
158 'paste_use_dialog': 'false',
159 'paste_auto_cleanup_on_paste': 'true',
160 'paste_convert_headers_to_strong': 'false',
161 'paste_strip_class_attributes': 'all',
162 'paste_remove_spans': 'true',
163 'paste_remove_styles': 'true',
164 'content_css': '/media/css/tinymce.css',
165 }
166
167 # django-sendfile
168 SENDFILE_BACKEND = 'sendfile.backends.simple'
169
170 QBE_DISPLAY_DATABASES = False
171
172 # Il est *très* important de respecter la case.
173 QBE_CUSTOM_MODELS = {'Rh': {
174 'Employe': {},
175 'Poste': {},
176 'Dossier': {},
177 'Remuneration': {},
178 'Contrat': {},
179 }}
180
181 QBE_ALLOWED_FIELDS = {'Rh': {
182 'Employe': [
183 'nom', 'prenom', 'genre', 'date_naissance', 'situation_familiale',
184 'date_entree'
185 ],
186 'Poste': ['nom', 'date_debut', 'date_fin'],
187 'Dossier': [
188 'statut_residence', 'regime_travail',
189 'regime_travail_nb_heure_semaine', 'date_debut', 'date_fin'
190 ],
191 'Remuneration': ['montant', 'date_debut', 'date_fin'],
192 'Contrat': ['date_debut', 'date_fin'],
193 }}
194
195 SOUTH_TESTS_MIGRATE = False
196
197 LOGGING = {
198 'version': 1,
199 'disable_existing_loggers': True,
200 'root': {
201 'level': 'WARNING',
202 'handlers': ['sentry'],
203 },
204 'formatters': {
205 'verbose': {
206 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
207 },
208 },
209 'handlers': {
210 'sentry': {
211 'level': 'WARNING',
212 'class': 'raven.contrib.django.handlers.SentryHandler',
213 },
214 'console': {
215 'level': 'DEBUG',
216 'class': 'logging.StreamHandler',
217 'formatter': 'verbose'
218 }
219 },
220 'loggers': {
221 'django.db.backends': {
222 'level': 'ERROR',
223 'handlers': ['console'],
224 'propagate': False,
225 },
226 'raven': {
227 'level': 'DEBUG',
228 'handlers': ['console'],
229 'propagate': False,
230 },
231 'sentry.errors': {
232 'level': 'DEBUG',
233 'handlers': ['console'],
234 'propagate': False,
235 },
236 },
237 }