]> git.0d.be Git - panikweb.git/blob - panikweb/settings.py
add panikombo dependency, for the soundfile cell type
[panikweb.git] / panikweb / settings.py
1 #!/usr/bin/env python
2 # coding: utf-8
3
4 import os
5
6 import django.conf.global_settings as DEFAULT_SETTINGS
7
8 DEBUG = True  # Turn off for production
9 TEMPLATE_DEBUG = DEBUG
10 DEBUG_TOOLBAR = False
11
12 PROJECT_DIR = os.path.normpath(os.path.dirname(os.path.dirname(__file__)))
13 ADMINS = (
14     # ('Your Name', 'your_email@domain.com'),
15 )
16 MANAGERS = ADMINS
17 DEFAULT_FROM_EMAIL = 'info@radiopanik.org'
18
19 LOGIN_REDIRECT_URL = '/'
20
21 DATABASES = {
22     'default': {
23         'ENGINE': 'django.db.backends.sqlite3',
24         'NAME': os.path.join(PROJECT_DIR, 'panikweb.sqlite3'),
25         'USER': '',
26         'PASSWORD': '',
27         'HOST': '',
28         'PORT': '',
29     },
30 }
31
32 ACCOUNT_ACTIVATION_DAYS = 7  # Activation window
33
34 #if django.VERSION[:2] < (1, 6):
35 TEST_RUNNER = 'discover_runner.DiscoverRunner'
36
37 # Local time zone for this installation. Choices can be found here:
38 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
39 # although not all choices may be available on all operating systems.
40 # If running in a Windows environment this must be set to the same as your
41 # system time zone.
42 TIME_ZONE = 'Europe/Brussels'
43
44 # Language code for this installation. All choices can be found here:
45 # http://www.i18nguy.com/unicode/language-identifiers.html
46 LANGUAGE_CODE = 'fr-be'
47
48 LANGUAGES = (
49   ('fr', u'Français'),
50 )
51
52 SITE_ID = 1
53
54 # If you set this to False, Django will make some optimizations so as not
55 # to load the internationalization machinery.
56 USE_I18N = True
57
58 LOCALE_PATHS = (os.path.join(PROJECT_DIR, 'panikweb', 'locale'),)
59
60 # Absolute filesystem path to the directory that will hold user-uploaded files.
61 # Example: "/home/media/media.lawrence.com/media/"
62 MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media')
63
64 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
65 # trailing slash.
66 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
67 MEDIA_URL = '/media/'
68
69 # Absolute path to the directory static files should be collected to.
70 # Don't put anything in this directory yourself; store your static files
71 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
72 # Example: "/home/media/media.lawrence.com/static/"
73 STATIC_ROOT = os.path.join(PROJECT_DIR, 'staticroot')
74
75 # URL prefix for static files.
76 # Example: "http://media.lawrence.com/static/"
77 STATIC_URL = '/static/'
78
79 # Additional locations of static files
80 STATICFILES_DIRS = (
81     # Put strings here, like "/home/html/static" or "C:/www/django/static".
82     # Always use forward slashes, even on Windows.
83     # Don't forget to use absolute paths, not relative paths.
84 )
85
86 # List of finder classes that know how to find static files in
87 # various locations.
88 STATICFILES_FINDERS = (
89     'django.contrib.staticfiles.finders.FileSystemFinder',
90     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
91     'compressor.finders.CompressorFinder',
92 #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
93 )
94
95 # Make this unique, and don't share it with anybody.
96 SECRET_KEY = '3qm&amp;@6264-=st16)7_xa*ds+31e0mqqs@+*!ud7gzt$tq!b^qn'
97
98 # List of callables that know how to import templates from various sources.
99 TEMPLATE_LOADERS = (
100     'django.template.loaders.filesystem.Loader',
101     'django.template.loaders.app_directories.Loader',
102 #     'django.template.loaders.eggs.load_template_source',
103 )
104
105 MIDDLEWARE_CLASSES = (
106     'django.middleware.cache.UpdateCacheMiddleware',
107     #'django.middleware.gzip.GZipMiddleware',
108     'django.contrib.sessions.middleware.SessionMiddleware',
109     'django.middleware.common.CommonMiddleware',
110     'django.middleware.csrf.CsrfViewMiddleware',
111     'django.contrib.auth.middleware.AuthenticationMiddleware',
112     'django.contrib.messages.middleware.MessageMiddleware',
113     #'request.middleware.RequestMiddleware',
114     'panikweb.middleware.StripPiwikCookieMiddleware',
115     'django.middleware.cache.FetchFromCacheMiddleware',
116 )
117
118 TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_SETTINGS.TEMPLATE_CONTEXT_PROCESSORS + (
119     'django.core.context_processors.request',
120 )
121
122
123 ROOT_URLCONF = 'panikweb.urls'
124
125 TEMPLATE_DIRS = (
126     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
127     # Always use forward slashes, even on Windows.
128     # Don't forget to use absolute paths, not relative paths.
129 )
130
131 INSTALLED_APPS = (
132     'django.contrib.auth',
133     'django.contrib.contenttypes',
134     'django.contrib.sessions',
135     'django.contrib.sites',
136     'django.contrib.messages',
137     'django.contrib.staticfiles',
138     'django.contrib.admin',
139     'django.contrib.admindocs',
140     'haystack',
141     'taggit',
142     'panikweb_templates',
143     'panikweb.paniktags',
144     'mptt',
145     'compressor',
146     'jquery',
147     'ckeditor',
148     'emissions',
149     'newsletter',
150     'nonstop',
151     'combo.data',
152     'combo.public',
153     'panikombo',
154 )
155
156 CKEDITOR_UPLOAD_PATH = os.path.join(MEDIA_ROOT, 'uploads')
157 CKEDITOR_UPLOAD_PREFIX = '/media/uploads/'
158
159 HAYSTACK_CONNECTIONS = {
160     'default': {
161         'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
162         'URL': 'http://127.0.0.1:8985/solr/panik'
163     },
164 }
165
166 FIBER_TEMPLATE_CHOICES = (
167     ('tpl-default.html', 'Default template'),
168 )
169
170 ENABLE_PIWIK = False
171
172 CACHES = {
173     'default': {
174         'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
175     },
176 }
177
178 LOGGING = {
179     'version': 1,
180     'disable_existing_loggers': False,
181     'filters': {
182         'require_debug_false': {
183             '()': 'django.utils.log.RequireDebugFalse'
184         }
185     },
186     'handlers': {
187         'mail_admins': {
188             'level': 'ERROR',
189             'filters': ['require_debug_false'],
190             'class': 'django.utils.log.AdminEmailHandler'
191         }
192     },
193     'loggers': {
194         'django.request': {
195             'handlers': ['mail_admins'],
196             'level': 'ERROR',
197             'propagate': True,
198         },
199     }
200 }
201
202 STATSD_CLIENT = 'django_statsd.clients.null'
203
204 RAVEN_CONFIG = None
205
206 DEBUG_TOOLBAR_PANELS = (
207     'debug_toolbar.panels.version.VersionDebugPanel',
208     'debug_toolbar.panels.timer.TimerDebugPanel',
209     'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
210     'debug_toolbar.panels.headers.HeaderDebugPanel',
211     'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
212     'debug_toolbar.panels.sql.SQLDebugPanel',
213     'debug_toolbar.panels.template.TemplateDebugPanel',
214     'debug_toolbar.panels.signals.SignalDebugPanel',
215     'debug_toolbar.panels.logger.LoggingPanel',
216 )
217
218 COMBO_PUBLIC_TEMPLATES = {
219     'standard': {
220         'name': 'Standard',
221         'template': 'combo/page_template.html',
222         'placeholders': {
223             'content': {
224                 'name': 'Content',
225             },
226         }
227     },
228 }
229
230
231
232 try:
233     from local_settings import *
234 except ImportError, e:
235     pass
236
237 if DEBUG and DEBUG_TOOLBAR:
238     MIDDLEWARE_CLASSES += (
239         'debug_toolbar.middleware.DebugToolbarMiddleware',
240     )
241     INSTALLED_APPS += (
242         'debug_toolbar',
243     )
244
245     if 'template_timings_panel.panels.TemplateTimings.TemplateTimings' in DEBUG_TOOLBAR_PANELS:
246         INSTALLED_APPS += ('template_timings_panel',)
247
248 if ENABLE_PIWIK is False:
249     MIDDLEWARE_CLASSES = tuple([x for x in MIDDLEWARE_CLASSES \
250                                 if x != 'panikweb.middleware.StripPiwikCookieMiddleware'])
251
252 if STATSD_CLIENT != 'django_statsd.clients.null':
253     MIDDLEWARE_CLASSES = (
254             'django_statsd.middleware.GraphiteRequestTimingMiddleware',
255             'django_statsd.middleware.GraphiteMiddleware',
256     ) + MIDDLEWARE_CLASSES
257     INSTALLED_APPS += (
258         'django_statsd',
259     )
260
261 if RAVEN_CONFIG:
262     INSTALLED_APPS += (
263         'raven.contrib.django.raven_compat',
264     )