Project

General

Profile

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

calebasse / calebasse / settings / common.py @ 92ea6229

1
# Django settings for calebasse project.
2

    
3
import os
4
from logging.handlers import SysLogHandler
5

    
6
from ..settings import PROJECT_PATH
7

    
8
DEBUG = True
9
TEMPLATE_DEBUG = True
10

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

    
15
MANAGERS = ADMINS
16

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

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

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

    
41
SITE_ID = 1
42

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

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

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

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

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

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

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

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

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

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

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

    
100
MIDDLEWARE_CLASSES = (
101
    'django.middleware.common.CommonMiddleware',
102
    'django.contrib.sessions.middleware.SessionMiddleware',
103
    'django.middleware.csrf.CsrfViewMiddleware',
104
    'django.contrib.auth.middleware.AuthenticationMiddleware',
105
    'django.contrib.messages.middleware.MessageMiddleware',
106
    'debug_toolbar.middleware.DebugToolbarMiddleware',
107
    # Uncomment the next line for simple clickjacking protection:
108
    # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
109
)
110

    
111
ROOT_URLCONF = 'calebasse.urls'
112

    
113
# Python dotted path to the WSGI application used by Django's runserver.
114
WSGI_APPLICATION = 'calebasse.wsgi.application'
115

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

    
123
TEMPLATE_CONTEXT_PROCESSORS = ("django.contrib.auth.context_processors.auth",
124
    "django.core.context_processors.debug",
125
    "django.core.context_processors.i18n",
126
    "django.core.context_processors.media",
127
    "django.core.context_processors.static",
128
    "django.core.context_processors.tz",
129
    "django.core.context_processors.request",
130
    "django.contrib.messages.context_processors.messages")
131

    
132
FIXTURE_DIRS = (
133
        os.path.join(PROJECT_PATH, 'fixtures'),
134
)
135

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

    
159
INTERNAL_IPS=('127.0.0.1',)
160

    
161
# A sample logging configuration. The only tangible logging
162
# performed by this configuration is to send an email to
163
# the site admins on every HTTP 500 error when DEBUG=False.
164
# See http://docs.djangoproject.com/en/dev/topics/logging for
165
# more details on how to customize your logging configuration.
166
LOGGING = {
167
    'version': 1,
168
    'disable_existing_loggers': False,
169
    'filters': {
170
        'require_debug_false': {
171
            '()': 'django.utils.log.RequireDebugFalse'
172
        }
173
    },
174
    'handlers': {
175
        'mail_admins': {
176
            'level': 'ERROR',
177
            'filters': ['require_debug_false'],
178
            'class': 'django.utils.log.AdminEmailHandler'
179
        },
180
        'syslog':{
181
            'level':'INFO',
182
            'class':'logging.handlers.SysLogHandler', 
183
            'facility': SysLogHandler.LOG_LOCAL0,
184
            'address': '/dev/log',
185
        },
186
    },
187
    'loggers': {
188
        '': {
189
            'handlers': ['mail_admins','syslog'],
190
            'level': 'INFO',
191
        },
192
    },
193
}
194

    
195
# AJAX Select
196
AJAX_LOOKUP_CHANNELS = {
197
    #   pass a dict with the model and the field to search against
198
    'worker'  : {'model':'personnes.Worker', 'search_field':'display_name'},
199
    'patientrecord'  : {'model':'dossiers.PatientRecord', 'search_field':'display_name'}
200
}
(3-3/4)