session logout
[auf_rh_dae.git] / project / settings.py
1 # -*- encoding: utf-8 -*-
2
3 import os
4 import socket
5 from conf import *
6 PROJET_TITRE = "Ressources humaines"
7
8 # Rapports d'erreurs
9 EMAIL_SUBJECT_PREFIX = '[auf_rh_dae - %s] ' % socket.gethostname()
10 ADMINS = (
11 ('Équipe ARI-SI', 'developpeurs@ca.auf.org'),
12 )
13
14 MANAGERS = ADMINS
15
16 TIME_ZONE = 'America/Montreal'
17 DATE_FORMAT = 'd-m-Y'
18 DATE_INPUT_FORMATS = (
19 '%d-%m-%Y', '%d/%m/%Y', '%d %m %Y',
20 '%d-%m-%y', '%d/%m/%y', '%d %m %y',
21 )
22
23 SESSION_SAVE_EVERY_REQUEST = True
24 SESSION_EXPIRE_AT_BROWSER_CLOSE = True
25
26 SHORT_DATE_FORMAT = 'd-m-Y'
27 LANGUAGE_CODE = 'fr-ca'
28
29 # Absolute path to the directory that holds media.
30 # Example: "/home/media/media.lawrence.com/"
31 MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'media')
32 PRIVE_MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'media_prive')
33
34 STATICFILES_DIRS = (
35 os.path.join(os.path.dirname(__file__), 'assets'),
36 )
37
38
39 STATIC_ROOT = os.path.join(os.path.dirname(__file__), 'static')
40 STATIC_URL = '/static/'
41
42 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
43 # trailing slash if there is a path component (optional in other cases).
44 # Examples: "http://media.lawrence.com", "http://example.com/media/"
45 MEDIA_URL = '/media/'
46 PRIVE_MEDIA_URL = '/rh/prive/'
47 OE_PRIVE_MEDIA_URL = '/recrutement/prive/'
48
49 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
50 # trailing slash.
51 # Examples: "http://foo.com/media/", "/media/".
52 #ADMIN_MEDIA_PREFIX = '/media/django/'
53
54 # Don't share this with anybody.
55 SECRET_KEY = '^2w#%abp_d+e#(7f5w$leef50)c@4y38cnn#ccji@84$2^rt#l'
56
57 MIDDLEWARE_CLASSES = (
58 'django.middleware.common.CommonMiddleware',
59 'django.contrib.sessions.middleware.SessionMiddleware',
60 'django.contrib.messages.middleware.MessageMiddleware',
61 'django.contrib.auth.middleware.AuthenticationMiddleware',
62 'django.middleware.doc.XViewMiddleware',
63 'reversion.middleware.RevisionMiddleware',
64 )
65
66 ROOT_URLCONF = 'project.urls'
67
68 INSTALLED_APPS = (
69 'auf.django.skin',
70 'auf.django.references',
71 'admin_tools',
72 'admin_tools.theming',
73 'admin_tools.menu',
74 'admin_tools.dashboard',
75 'django.contrib.auth',
76 'django.contrib.contenttypes',
77 'django.contrib.messages',
78 'django.contrib.sessions',
79 'django.contrib.admin',
80 'django.contrib.staticfiles',
81 'django_qbe',
82 'auf.django.emploi',
83 'auf.django.admingroup',
84 'ajax_select',
85 'south',
86 'reversion',
87 'auf.django.workflow',
88 'auf.django.permissions',
89 #'project.rh_v1',
90 'project.rh',
91 'project.dae',
92 'project.legacy',
93 'alphafilter',
94 'auf.django.emploi',
95 'project.recrutement',
96 'form_utils',
97 'tinymce',
98 'captcha',
99 'idle',
100 )
101
102 TEMPLATE_CONTEXT_PROCESSORS = (
103 'django.core.context_processors.auth',
104 'django.core.context_processors.debug',
105 'django.core.context_processors.i18n',
106 'django.core.context_processors.media',
107 'django.core.context_processors.static',
108 'django.contrib.messages.context_processors.messages',
109 'django.core.context_processors.request',
110 'auf.django.skin.context_processors.auf',
111 'project.context_processors.this_employe',
112 'project.context_processors.user_is_admin',
113 'dae.context_processors.user_in_dae_groupes',
114 'recrutement.context_processors.user_in_recrutement_groupes',
115 )
116
117 AUTHENTICATION_BACKENDS = (
118 'auf.django.auth.backends.CascadeBackend',
119 'auf.django.permissions.backends.AuthenticationBackend',
120 )
121 LOGIN_URL = "/connexion"
122 LOGIN_REDIRECT_URL = "/"
123
124 TEMPLATE_DIRS = (
125 os.path.join(os.path.dirname(__file__), "templates"),
126 )
127
128
129 ADMIN_TOOLS_INDEX_DASHBOARD = 'project.dashboard.CustomIndexDashboard'
130 ADMIN_TOOLS_APP_INDEX_DASHBOARD = 'project.dashboard.CustomAppIndexDashboard'
131 ADMIN_TOOLS_MENU = 'project.menu.CustomMenu'
132
133 AJAX_LOOKUP_CHANNELS = {
134 'responsables' : ('dae.catalogues', 'Responsable'),
135 'dossiers' : ('dae.catalogues', 'Dossier'),
136 'postes' : ('dae.catalogues', 'Poste'),
137 'pays' : ('rh.catalogues', 'Pays'),
138 'implantations' : ('rh.catalogues', 'Implantation'),
139 'typepostes' : ('rh.catalogues', 'TypePoste'),
140 'postes' : ('rh.catalogues', 'Poste'),
141 'valeurpoints' : ('rh.catalogues', 'ValeurPoint'),
142 'employes' : ('rh.catalogues', 'Employe'),
143 'dossiers' : ('rh.catalogues', 'Dossier'),
144 }
145 AJAX_SELECT_BOOTSTRAP = True
146 AJAX_SELECT_INLINES = 'inline'
147
148
149 TINYMCE_DEFAULT_CONFIG = {
150 'theme': "advanced",
151 'plugins':"paste",
152 'theme_advanced_buttons1' : "bold,italic,underline,|,formatselect,|,bullist,numlist,|,undo,redo,|,link,unlink",
153 'theme_advanced_buttons2' : "",
154 'theme_advanced_buttons3' : "",
155 'theme_advanced_statusbar_location' : "bottom",
156 'theme_advanced_toolbar_align' : "left",
157 'theme_advanced_styles' : "Titre=titre;Sous-titre=sous-titre;Normal=normal",
158 'width' : "800",
159 'height' : "200",
160 'theme_advanced_resizing' : "true",
161 'custom_undo_redo_levels': 10,
162 'theme_advanced_toolbar_location' : 'top',
163 'inline_styles' : 'false',
164 'paste_use_dialog' : 'false',
165 'paste_auto_cleanup_on_paste' : 'true',
166 'paste_convert_headers_to_strong' : 'false',
167 'paste_strip_class_attributes' : 'all',
168 'paste_remove_spans' : 'true',
169 'paste_remove_styles' : 'true',
170 'content_css' : '/media/css/tinymce.css',
171 }
172
173 DATABASE_ROUTERS = (
174 'project.legacy.DatabaseRouter',
175 )
176
177 # django-sendfile
178 SENDFILE_BACKEND = 'sendfile.backends.simple'