Project

General

Profile

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

calebasse / calebasse / settings / common.py @ 9123ecac

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
)
115

    
116
ROOT_URLCONF = 'calebasse.urls'
117

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

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

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

    
137
FIXTURE_DIRS = (
138
        os.path.join(PROJECT_PATH, 'fixtures'),
139
)
140

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

    
165
INTERNAL_IPS=('127.0.0.1',)
166
DEBUG_TOOLBAR_CONFIG = {
167
    'INTERCEPT_REDIRECTS': False,
168
}
169

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

    
225
# AJAX Select
226
AJAX_LOOKUP_CHANNELS = {
227
    #   pass a dict with the model and the field to search against
228
    'worker' : ('calebasse.personnes.lookup', 'Worker'),
229
    #'patientrecord'  : {'model':'dossiers.PatientRecord', 'search_field':'display_name'}
230
    #'coordinators'  : {'model':'dossiers.PatientRecord', 'search_field':'display_name'}
231
    'patientrecord' : ('calebasse.dossiers.lookups', 'PatientRecordLookup'),
232
    'school' : {'model':'ressources.School', 'search_field':'name'},
233
    'addresses' : ('calebasse.dossiers.lookups', 'PatientAddressLookup'),
234
    'worker-or-group' : ('calebasse.ressources.lookups', 'WorkerOrGroupLookup'),
235
}
236

    
237
# Default URL after login
238
LOGIN_REDIRECT_URL = '/'
239

    
240
# Base directory for generated patient files
241
PATIENT_FILES_BASE_DIRECTORY = '/home/jschneider/temp/target/'
242

    
243
# Client side base directory for generated patient files
244
CLIENT_SIDE_PATIENT_FILES_BASE_DIRECTORY =  None
245

    
246
# Patient subdirectories
247
PATIENT_SUBDIRECTORIES = (
248
    u'Assistante sociale',
249
    u'Consultation',
250
    u'Courriers',
251
    u'Demande',
252
    u'Demandes prises en charge',
253
    u'Ergothérapie',
254
    u'Groupe',
255
    u'Kinésithérapie',
256
    u'Logico-mathématiques',
257
    u'Neuro-psychologie',
258
    u'Orientation',
259
    u'Orthophonie',
260
    u'Psychologie',
261
    u'Psychomotricité',
262
    u'Psychopédagogue',
263
    u'Synthèses',
264
    u'TCC',
265
)
266

    
267
# RTF templates directory
268
RTF_TEMPLATES_DIRECTORY = '/home/jschneider/temp/templates/'
(3-3/4)