]> git.0d.be Git - panikweb.git/blob - panikweb/settings.py
add new map settings
[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 DEBUG_TOOLBAR = False
10
11 PROJECT_DIR = os.path.normpath(os.path.dirname(os.path.dirname(__file__)))
12 ADMINS = (
13     # ('Your Name', 'your_email@domain.com'),
14 )
15 MANAGERS = ADMINS
16 DEFAULT_FROM_EMAIL = 'radio@esperanzah.be'
17 ALLOWED_HOSTS = ['radio-2017.esperanzah.be', 'radio.esperanzah.be']
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   ('en', u'English'),
51 )
52
53 SITE_ID = 1
54
55 # If you set this to False, Django will make some optimizations so as not
56 # to load the internationalization machinery.
57 USE_I18N = True
58
59 LOCALE_PATHS = (os.path.join(PROJECT_DIR, 'panikweb', 'locale'),)
60
61 # Absolute filesystem path to the directory that will hold user-uploaded files.
62 # Example: "/home/media/media.lawrence.com/media/"
63 MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media')
64
65 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
66 # trailing slash.
67 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
68 MEDIA_URL = '/media/'
69
70 # Absolute path to the directory static files should be collected to.
71 # Don't put anything in this directory yourself; store your static files
72 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
73 # Example: "/home/media/media.lawrence.com/static/"
74 STATIC_ROOT = os.path.join(PROJECT_DIR, 'staticroot')
75
76 # URL prefix for static files.
77 # Example: "http://media.lawrence.com/static/"
78 STATIC_URL = '/static/'
79
80 # Additional locations of static files
81 STATICFILES_DIRS = (
82     # Put strings here, like "/home/html/static" or "C:/www/django/static".
83     # Always use forward slashes, even on Windows.
84     # Don't forget to use absolute paths, not relative paths.
85 )
86
87 # List of finder classes that know how to find static files in
88 # various locations.
89 STATICFILES_FINDERS = (
90     'django.contrib.staticfiles.finders.FileSystemFinder',
91     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
92     'gadjo.finders.XStaticFinder',
93 #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
94 )
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 MIDDLEWARE_CLASSES = (
101     'django.middleware.cache.UpdateCacheMiddleware',
102     #'django.middleware.gzip.GZipMiddleware',
103     'django.contrib.sessions.middleware.SessionMiddleware',
104     'django.middleware.locale.LocaleMiddleware',
105     'django.middleware.common.CommonMiddleware',
106     'django.middleware.csrf.CsrfViewMiddleware',
107     'django.contrib.auth.middleware.AuthenticationMiddleware',
108     'django.contrib.messages.middleware.MessageMiddleware',
109     #'request.middleware.RequestMiddleware',
110     'panikweb.middleware.StripPiwikCookieMiddleware',
111     'django.middleware.cache.FetchFromCacheMiddleware',
112 )
113
114 TEMPLATES = [
115     {
116         'BACKEND': 'django.template.backends.django.DjangoTemplates',
117         'DIRS': [
118             os.path.join(PROJECT_DIR, 'panikweb_templates'),
119         ],
120         'APP_DIRS': True,
121         'OPTIONS': {
122             'context_processors': [
123                 'django.contrib.auth.context_processors.auth',
124                 'django.template.context_processors.debug',
125                 'django.template.context_processors.i18n',
126                 'django.template.context_processors.media',
127                 'django.template.context_processors.request',
128                 'django.template.context_processors.static',
129                 'django.template.context_processors.tz',
130                 'panikweb.context_processors.site_url',
131             ],
132             'builtins': [
133                 'combo.public.templatetags.combo',
134             ],
135         },
136     },
137 ]
138
139
140 ROOT_URLCONF = 'panikweb.urls'
141
142 INSTALLED_APPS = (
143     'django.contrib.auth',
144     'django.contrib.contenttypes',
145     'django.contrib.sessions',
146     'django.contrib.sites',
147     'django.contrib.messages',
148     'django.contrib.staticfiles',
149     'django.contrib.admin',
150     'django.contrib.admindocs',
151     'haystack',
152     'taggit',
153     'gadjo',
154     'panikweb_templates',
155     'panikweb.paniktags',
156     'panikweb.archives',
157     'sorl.thumbnail',
158     'ckeditor',
159     'emissions',
160     'newsletter',
161     'nonstop',
162     'combo.data',
163     'combo.public',
164     'combo.profile',
165     'combo.apps.maps',
166     'combo.apps.search',
167     'combo.apps.dashboard',
168     'panikombo',
169     'gallery',
170 )
171
172 CKEDITOR_UPLOAD_PATH = os.path.join(MEDIA_ROOT, 'uploads')
173 CKEDITOR_UPLOAD_PREFIX = '/media/uploads/'
174
175 HAYSTACK_CONNECTIONS = {
176     'default': {
177         'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
178         'URL': 'http://127.0.0.1:8985/solr/panik'
179     },
180 }
181
182 FIBER_TEMPLATE_CHOICES = (
183     ('tpl-default.html', 'Default template'),
184 )
185
186 ENABLE_PIWIK = False
187
188 CACHES = {
189     'default': {
190         'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
191     },
192 }
193
194 LOGGING = {
195     'version': 1,
196     'disable_existing_loggers': False,
197     'filters': {
198         'require_debug_false': {
199             '()': 'django.utils.log.RequireDebugFalse'
200         }
201     },
202     'handlers': {
203         'mail_admins': {
204             'level': 'ERROR',
205             'filters': ['require_debug_false'],
206             'class': 'django.utils.log.AdminEmailHandler'
207         }
208     },
209     'loggers': {
210         'django.request': {
211             'handlers': ['mail_admins'],
212             'level': 'ERROR',
213             'propagate': True,
214         },
215     }
216 }
217
218 STATSD_CLIENT = 'django_statsd.clients.null'
219
220 RAVEN_CONFIG = None
221
222 DEBUG_TOOLBAR_PANELS = (
223     'debug_toolbar.panels.version.VersionDebugPanel',
224     'debug_toolbar.panels.timer.TimerDebugPanel',
225     'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
226     'debug_toolbar.panels.headers.HeaderDebugPanel',
227     'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
228     'debug_toolbar.panels.sql.SQLDebugPanel',
229     'debug_toolbar.panels.template.TemplateDebugPanel',
230     'debug_toolbar.panels.signals.SignalDebugPanel',
231     'debug_toolbar.panels.logger.LoggingPanel',
232 )
233
234 from panikombo.misc import COMBO_PUBLIC_TEMPLATES
235
236 LANGUAGE_COOKIE_NAME = 'panikweb_language'
237
238 TEMPLATE_VARS = {}
239
240 COMBO_DASHBOARD_ENABLED = False
241 JSON_CELL_TYPES = {}
242
243 WEBSITE_BASE_URL = 'http://www.radiopanik.org/'
244
245 COMBO_INITIAL_LOGIN_PAGE_PATH = '/'
246 COMBO_WELCOME_PAGE_PATH = None
247
248 try:
249     from .local_settings import *
250 except ImportError as e:
251     pass
252
253 if DEBUG and DEBUG_TOOLBAR:
254     MIDDLEWARE_CLASSES += (
255         'debug_toolbar.middleware.DebugToolbarMiddleware',
256     )
257     INSTALLED_APPS += (
258         'debug_toolbar',
259     )
260
261     if 'template_timings_panel.panels.TemplateTimings.TemplateTimings' in DEBUG_TOOLBAR_PANELS:
262         INSTALLED_APPS += ('template_timings_panel',)
263
264 if ENABLE_PIWIK is False:
265     MIDDLEWARE_CLASSES = tuple([x for x in MIDDLEWARE_CLASSES \
266                                 if x != 'panikweb.middleware.StripPiwikCookieMiddleware'])
267
268 if STATSD_CLIENT != 'django_statsd.clients.null':
269     MIDDLEWARE_CLASSES = (
270             'django_statsd.middleware.GraphiteRequestTimingMiddleware',
271             'django_statsd.middleware.GraphiteMiddleware',
272     ) + MIDDLEWARE_CLASSES
273     INSTALLED_APPS += (
274         'django_statsd',
275     )
276
277 if RAVEN_CONFIG:
278     INSTALLED_APPS += (
279         'raven.contrib.django.raven_compat',
280     )
281
282 AUTH_USER_MODEL = 'aa.User'
283 INSTALLED_APPS += ('panikdb.aa',)
284
285 COMBO_DASHBOARD_ENABLED = False
286 COMBO_MAP_TILE_URLTEMPLATE = ''
287 COMBO_MAP_ATTRIBUTION = ''
288
289 JSON_CELL_TYPES = {}