Project

General

Profile

Download (9.96 KB) Statistics
| Branch: | Tag: | Revision:

calebasse / calebasse / settings / common.py @ 8da5a7b6

1
# -*- coding: utf-8 -*-
2

    
3
# Django settings for calebasse project.
4

    
5
import os
6
from logging.handlers import SysLogHandler
7

    
8
from ..settings import PROJECT_PATH
9

    
10
DEBUG = True
11
TEMPLATE_DEBUG = True
12

    
13
ADMINS = (
14
    # ('Your Name', 'your_email@example.com'),
15
)
16

    
17
MANAGERS = ADMINS
18

    
19
DATABASES = {
20
    'default': {
21
        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
22
        'NAME': os.path.join(PROJECT_PATH, 'calebasse.sqlite3'),                      # Or path to database file if using sqlite3.
23
        'USER': '',                      # Not used with sqlite3.
24
        'PASSWORD': '',                  # Not used with sqlite3.
25
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
26
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
27
    }
28
}
29

    
30
# Local time zone for this installation. Choices can be found here:
31
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
32
# although not all choices may be available on all operating systems.
33
# On Unix systems, a value of None will cause Django to use the same
34
# timezone as the operating system.
35
# If running in a Windows environment this must be set to the same as your
36
# system time zone.
37
TIME_ZONE = 'Europe/Paris'
38

    
39
# Language code for this installation. All choices can be found here:
40
# http://www.i18nguy.com/unicode/language-identifiers.html
41
LANGUAGE_CODE = 'fr-fr'
42

    
43
SITE_ID = 1
44

    
45
# If you set this to False, Django will make some optimizations so as not
46
# to load the internationalization machinery.
47
USE_I18N = True
48

    
49
# If you set this to False, Django will not format dates, numbers and
50
# calendars according to the current locale.
51
USE_L10N = True
52
FORMAT_MODULE_PATH = 'calebasse.settings.formats'
53

    
54
# If you set this to False, Django will not use timezone-aware datetimes.
55
USE_TZ = False
56

    
57
# Absolute filesystem path to the directory that will hold user-uploaded files.
58
# Example: "/home/media/media.lawrence.com/media/"
59
MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media')
60

    
61
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
62
# trailing slash.
63
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
64
MEDIA_URL = '/media/'
65

    
66
# Absolute path to the directory static files should be collected to.
67
# Don't put anything in this directory yourself; store your static files
68
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
69
# Example: "/home/media/media.lawrence.com/static/"
70
STATIC_ROOT = os.path.join(os.path.join(PROJECT_PATH, '..'), 'static')
71

    
72
# URL prefix for static files.
73
# Example: "http://media.lawrence.com/static/"
74
STATIC_URL = '/static/'
75

    
76
# Additional locations of static files
77
STATICFILES_DIRS = (
78
    # Put strings here, like "/home/html/static" or "C:/www/django/static".
79
    # Always use forward slashes, even on Windows.
80
    # Don't forget to use absolute paths, not relative paths.
81
    os.path.join(PROJECT_PATH, 'static'),
82
)
83

    
84
# List of finder classes that know how to find static files in
85
# various locations.
86
STATICFILES_FINDERS = (
87
    'django.contrib.staticfiles.finders.FileSystemFinder',
88
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
89
#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
90
)
91

    
92
# Make this unique, and don't share it with anybody.
93
SECRET_KEY = 'ct(a@ny^_)8v-^)jkdzbktqg6ajfn6y!zdjum^(f_o!h0jeotq'
94

    
95
# List of callables that know how to import templates from various sources.
96
TEMPLATE_LOADERS = (
97
    'django.template.loaders.filesystem.Loader',
98
    'django.template.loaders.app_directories.Loader',
99
#     'django.template.loaders.eggs.Loader',
100
)
101

    
102
MIDDLEWARE_CLASSES = (
103
    'django.middleware.common.CommonMiddleware',
104
    'django.contrib.sessions.middleware.SessionMiddleware',
105
    'django.middleware.csrf.CsrfViewMiddleware',
106
    'django.contrib.auth.middleware.AuthenticationMiddleware',
107
    'django.contrib.messages.middleware.MessageMiddleware',
108
    #'debug_toolbar.middleware.DebugToolbarMiddleware',
109
    'calebasse.middleware.request.GlobalRequestMiddleware',
110
    # Uncomment the next line for simple clickjacking protection:
111
    # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
112
    'django.middleware.transaction.TransactionMiddleware',
113
    'reversion.middleware.RevisionMiddleware',
114
    # Entr'ouvert wsgi middleware to expose version
115
    'entrouvert.djommon.middleware.VersionMiddleware',
116
)
117

    
118
ROOT_URLCONF = 'calebasse.urls'
119

    
120
# Python dotted path to the WSGI application used by Django's runserver.
121
WSGI_APPLICATION = 'calebasse.wsgi.application'
122

    
123
TEMPLATE_DIRS = (
124
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
125
    # Always use forward slashes, even on Windows.
126
    # Don't forget to use absolute paths, not relative paths.
127
    os.path.join(PROJECT_PATH, "templates")
128
)
129

    
130
TEMPLATE_CONTEXT_PROCESSORS = ("django.contrib.auth.context_processors.auth",
131
    "django.core.context_processors.debug",
132
    "django.core.context_processors.i18n",
133
    "django.core.context_processors.media",
134
    "django.core.context_processors.static",
135
    "django.core.context_processors.tz",
136
    "django.core.context_processors.request",
137
    "django.contrib.messages.context_processors.messages")
138

    
139
FIXTURE_DIRS = (
140
        os.path.join(PROJECT_PATH, 'fixtures'),
141
)
142

    
143
INSTALLED_APPS = (
144
    'django.contrib.auth',
145
    'django.contrib.contenttypes',
146
    'django.contrib.sessions',
147
    'django.contrib.sites',
148
    'django.contrib.messages',
149
    'django.contrib.staticfiles',
150
    'reversion',
151
    'south',
152
    'django.contrib.admin',
153
    'ajax_select',
154
    #'debug_toolbar',
155
    'widget_tweaks',
156
    # Uncomment the next line to enable admin documentation:
157
    # 'django.contrib.admindocs',
158
    'calebasse.agenda',
159
    'calebasse.dossiers',
160
    'calebasse.actes',
161
    'calebasse.facturation',
162
    'calebasse.personnes',
163
    'calebasse.ressources',
164
    'calebasse.statistics',
165
    'calebasse.middleware.request',
166
    'south',
167
    'django_jenkins',
168
)
169

    
170
INTERNAL_IPS=('127.0.0.1',)
171
DEBUG_TOOLBAR_CONFIG = {
172
    'INTERCEPT_REDIRECTS': False,
173
}
174

    
175
# A sample logging configuration. The only tangible logging
176
# performed by this configuration is to send an email to
177
# the site admins on every HTTP 500 error when DEBUG=False.
178
# See http://docs.djangoproject.com/en/dev/topics/logging for
179
# more details on how to customize your logging configuration.
180
LOGGING = {
181
    'version': 1,
182
    'disable_existing_loggers': False,
183
    'filters': {
184
        'require_debug_false': {
185
            '()': 'django.utils.log.RequireDebugFalse'
186
        },
187
    },
188
    'formatters': {
189
        'verbose': {
190
            'format': '[%(asctime)s] %(levelname)-8s %(name)s.%(message)s',
191
            'datefmt': '%Y-%m-%d %a %H:%M:%S'
192
        },
193
    },
194
    'handlers': {
195
        'mail_admins': {
196
            'level': 'ERROR',
197
            'filters': ['require_debug_false'],
198
            'class': 'django.utils.log.AdminEmailHandler'
199
        },
200
        'console': {
201
            'level':'INFO',
202
            'class':'logging.StreamHandler',
203
            'formatter': 'verbose',
204
        },
205
        'local_file': {
206
            'level':'DEBUG',
207
            'class':'logging.FileHandler',
208
            'formatter': 'verbose',
209
            'filename': os.path.join(PROJECT_PATH, 'calebasse.log'),
210
        },
211
        'syslog':{
212
            'level':'INFO',
213
            'class':'logging.handlers.SysLogHandler',
214
            'facility': SysLogHandler.LOG_LOCAL0,
215
            'address': '/dev/log',
216
        },
217
    },
218
    'loggers': {
219
        '': {
220
            'handlers': ['mail_admins','syslog'],
221
            'level': 'INFO',
222
        },
223
    },
224
    'root': {
225
            'handlers': ['console', 'local_file'],
226
            'level': 'DEBUG',
227
    }
228
}
229

    
230
# AJAX Select
231
AJAX_LOOKUP_CHANNELS = {
232
    #   pass a dict with the model and the field to search against
233
    'worker' : ('calebasse.personnes.lookup', 'WorkerLookup'),
234
    'intervenant' : ('calebasse.personnes.lookup', 'IntervenantLookup'),
235
    #'patientrecord'  : {'model':'dossiers.PatientRecord', 'search_field':'display_name'}
236
    #'coordinators'  : {'model':'dossiers.PatientRecord', 'search_field':'display_name'}
237
    'patientrecord' : ('calebasse.dossiers.lookups', 'PatientRecordLookup'),
238
    'school' : {'model':'ressources.School', 'search_field':'name'},
239
    'addresses' : ('calebasse.dossiers.lookups', 'PatientAddressLookup'),
240
    'worker-or-group' : ('calebasse.ressources.lookups', 'WorkerOrGroupLookup'),
241
}
242

    
243
# Default URL after login
244
LOGIN_REDIRECT_URL = '/'
245

    
246
# Base directory for generated patient files
247
PATIENT_FILES_BASE_DIRECTORY = None
248

    
249
# Client side base directory for generated patient files
250
CLIENT_SIDE_PATIENT_FILES_BASE_DIRECTORY =  None
251

    
252
# Patient subdirectories
253
PATIENT_SUBDIRECTORIES = (
254
    u'Assistante sociale',
255
    u'Consultation',
256
    u'Courriers',
257
    u'Demande',
258
    u'Demandes prises en charge',
259
    u'Educateur spécialisé',
260
    u'Ergothérapie',
261
    u'Groupe',
262
    u'Kinésithérapie',
263
    u'Logico-mathématiques',
264
    u'Neuro-psychologie',
265
    u'Orientation',
266
    u'Orthophonie',
267
    u'Psychologie',
268
    u'Psychomotricité',
269
    u'Psychopédagogue',
270
    u'Synthèses',
271
    u'TCC',
272
)
273

    
274
# RTF templates directory
275
RTF_TEMPLATES_DIRECTORY = None
276
# Use patient home dictrory for RTF files generated
277
# PATIENT_FILES_BASE_DIRECTORY must be set to work
278
USE_PATIENT_FILE_RTF_REPOSITORY_DIRECTORY = False
279
# RTF files generated directory
280
RTF_REPOSITORY_DIRECTORY = None
281

    
282
# Invoicing file saving directory
283
INVOICING_DIRECTORY = None
284

    
285
# IRIS/B2 transmission
286
# B2_TRANSMISSION = {
287
#    'output_directory': '/var/lib/calebasse/B2/',
288
#    # B2 informations
289
#    'nom': 'CMPP FOOBAR',                      # mandatory
290
#    'numero_emetteur': '123456789',            # mandatory
291
#    'norme': 'CP  ',
292
#    'type_emetteur': 'TE',
293
#    'application': 'TR',
294
#    'categorie': '189',
295
#    'statut': '60',
296
#    'mode_tarif': '05',
297
#    'message': 'ENTROUVERT 0143350135 CALEBASSE 1307',
298
#    # SMTP configuration
299
#    'smtp_from': 'transmission@domain.net',    # mandatory
300
#    'smtp_host': '127.0.0.1',
301
#    'smtp_port': 25,
302
#    'smtp_login': '',
303
#    'smtp_password': '',
304
#    # delay between two mails, in seconds, or None
305
#    'smtp_delay': None,
306
# }
(3-3/4)