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