]> git.0d.be Git - panikweb.git/blob - panikweb/settings.py
episodes: order diffusion dates
[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     'fiber.middleware.ObfuscateEmailAddressMiddleware',
114     'fiber.middleware.AdminPageMiddleware',
115     #'request.middleware.RequestMiddleware',
116     'panikweb.middleware.StripPiwikCookieMiddleware',
117     'django.middleware.cache.FetchFromCacheMiddleware',
118 )
119
120 TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_SETTINGS.TEMPLATE_CONTEXT_PROCESSORS + (
121     'django.core.context_processors.request',
122 )
123
124
125 ROOT_URLCONF = 'panikweb.urls'
126
127 TEMPLATE_DIRS = (
128     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
129     # Always use forward slashes, even on Windows.
130     # Don't forget to use absolute paths, not relative paths.
131 )
132
133 INSTALLED_APPS = (
134     'django.contrib.auth',
135     'django.contrib.contenttypes',
136     'django.contrib.sessions',
137     'django.contrib.sites',
138     'django.contrib.messages',
139     'django.contrib.staticfiles',
140     'django.contrib.admin',
141     'django.contrib.admindocs',
142     'south',
143     'haystack',
144     'taggit',
145     'panikweb_templates',
146     'panikweb.paniktags',
147     'mptt',
148     'compressor',
149     'fiber',
150     'jquery',
151     'ckeditor',
152     'emissions',
153     'newsletter',
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 try:
219     from local_settings import *
220 except ImportError, e:
221     pass
222
223 if DEBUG and DEBUG_TOOLBAR:
224     MIDDLEWARE_CLASSES += (
225         'debug_toolbar.middleware.DebugToolbarMiddleware',
226     )
227     INSTALLED_APPS += (
228         'debug_toolbar',
229     )
230
231     if 'template_timings_panel.panels.TemplateTimings.TemplateTimings' in DEBUG_TOOLBAR_PANELS:
232         INSTALLED_APPS += ('template_timings_panel',)
233
234 if ENABLE_PIWIK is False:
235     MIDDLEWARE_CLASSES = tuple([x for x in MIDDLEWARE_CLASSES \
236                                 if x != 'panikweb.middleware.StripPiwikCookieMiddleware'])
237
238 if STATSD_CLIENT != 'django_statsd.clients.null':
239     MIDDLEWARE_CLASSES = (
240             'django_statsd.middleware.GraphiteRequestTimingMiddleware',
241             'django_statsd.middleware.GraphiteMiddleware',
242     ) + MIDDLEWARE_CLASSES
243     INSTALLED_APPS += (
244         'django_statsd',
245     )
246
247 if RAVEN_CONFIG:
248     INSTALLED_APPS += (
249         'raven.contrib.django.raven_compat',
250     )