Projet

Général

Profil

Télécharger (5,65 ko) Statistiques
| Branche: | Tag: | Révision:

calebasse / calebasse / settings / common.py @ 333a39ca

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 = DEBUG
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

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

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

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

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

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

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

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

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

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

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

    
108
ROOT_URLCONF = 'calebasse.urls'
109

    
110
# Python dotted path to the WSGI application used by Django's runserver.
111
WSGI_APPLICATION = 'calebasse.wsgi.application'
112

    
113
TEMPLATE_DIRS = (
114
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
115
    # Always use forward slashes, even on Windows.
116
    # Don't forget to use absolute paths, not relative paths.
117
)
118

    
119
INSTALLED_APPS = (
120
    'django.contrib.auth',
121
    'django.contrib.contenttypes',
122
    'django.contrib.sessions',
123
    'django.contrib.sites',
124
    'django.contrib.messages',
125
    'django.contrib.staticfiles',
126
    'reversion',
127
    'south',
128
    # Uncomment the next line to enable the admin:
129
    # 'django.contrib.admin',
130
    # Uncomment the next line to enable admin documentation:
131
    # 'django.contrib.admindocs',
132
    'calebasse.cale_base',
133
)
134

    
135
# A sample logging configuration. The only tangible logging
136
# performed by this configuration is to send an email to
137
# the site admins on every HTTP 500 error when DEBUG=False.
138
# See http://docs.djangoproject.com/en/dev/topics/logging for
139
# more details on how to customize your logging configuration.
140
LOGGING = {
141
    'version': 1,
142
    'disable_existing_loggers': False,
143
    'filters': {
144
        'require_debug_false': {
145
            '()': 'django.utils.log.RequireDebugFalse'
146
        }
147
    },
148
    'handlers': {
149
        'mail_admins': {
150
            'level': 'ERROR',
151
            'filters': ['require_debug_false'],
152
            'class': 'django.utils.log.AdminEmailHandler'
153
        },
154
        'syslog':{
155
            'level':'INFO',
156
            'class':'logging.handlers.SysLogHandler', 
157
            'formatter': 'syslog',
158
            'facility': SysLogHandler.LOG_LOCAL0,
159
            'address': '/dev/log',
160
        },
161
    },
162
    'loggers': {
163
        '': {
164
            'handlers': ['mail_admins','syslog'],
165
            'level': 'INFO',
166
        },
167
    },
168
}
(3-3/3)