]> git.0d.be Git - panikweb.git/blobdiff - panikweb/settings.py
add custom thumbnail backend to store .webp variants
[panikweb.git] / panikweb / settings.py
index 66c43c0d94c09dea84d5b2a19cd32b2e1e30885a..6e0b6416f0c745b2c6ff895bc2c435abd5599586 100644 (file)
@@ -1,5 +1,4 @@
 #!/usr/bin/env python
-# coding: utf-8
 
 import os
 
@@ -9,6 +8,8 @@ DEBUG = True  # Turn off for production
 DEBUG_TOOLBAR = False
 
 PROJECT_DIR = os.path.normpath(os.path.dirname(os.path.dirname(__file__)))
+PROJECT_PATH = os.path.dirname(os.path.dirname(__file__))
+
 ADMINS = (
     # ('Your Name', 'your_email@domain.com'),
 )
@@ -30,7 +31,7 @@ DATABASES = {
 
 ACCOUNT_ACTIVATION_DAYS = 7  # Activation window
 
-#if django.VERSION[:2] < (1, 6):
+# if django.VERSION[:2] < (1, 6):
 TEST_RUNNER = 'discover_runner.DiscoverRunner'
 
 # Local time zone for this installation. Choices can be found here:
@@ -45,8 +46,8 @@ TIME_ZONE = 'Europe/Brussels'
 LANGUAGE_CODE = 'fr-be'
 
 LANGUAGES = (
-  ('fr', u'Français'),
-  ('en', u'English'),
+    ('fr', 'Français'),
+    ('en', 'English'),
 )
 
 SITE_ID = 1
@@ -81,6 +82,7 @@ STATICFILES_DIRS = (
     # Put strings here, like "/home/html/static" or "C:/www/django/static".
     # Always use forward slashes, even on Windows.
     # Don't forget to use absolute paths, not relative paths.
+    os.path.join(PROJECT_PATH, 'panikweb', 'static'),
 )
 
 # List of finder classes that know how to find static files in
@@ -89,14 +91,14 @@ STATICFILES_FINDERS = (
     'django.contrib.staticfiles.finders.FileSystemFinder',
     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
     'gadjo.finders.XStaticFinder',
-#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
+    #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
 )
 
 
 # Make this unique, and don't share it with anybody.
 SECRET_KEY = '3qm&amp;@6264-=st16)7_xa*ds+31e0mqqs@+*!ud7gzt$tq!b^qn'
 
-MIDDLEWARE_CLASSES = (
+MIDDLEWARE = (
     'django.middleware.cache.UpdateCacheMiddleware',
     #'django.middleware.gzip.GZipMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
@@ -114,7 +116,7 @@ TEMPLATES = [
     {
         'BACKEND': 'django.template.backends.django.DjangoTemplates',
         'DIRS': [
-            os.path.join(PROJECT_DIR, 'panikweb_templates'),
+            os.path.join(PROJECT_DIR, 'panikweb', 'templates'),
         ],
         'APP_DIRS': True,
         'OPTIONS': {
@@ -151,13 +153,11 @@ INSTALLED_APPS = (
     'django.contrib.sites',
     'django.contrib.messages',
     'django.contrib.staticfiles',
-    'django.contrib.admin',
-    'django.contrib.admindocs',
     'haystack',
     'taggit',
     'gadjo',
-    'panikweb_templates',
     'panikweb.paniktags',
+    'panikweb.webstats',
     'sorl.thumbnail',
     'ckeditor',
     'emissions',
@@ -166,10 +166,15 @@ INSTALLED_APPS = (
     'combo.data',
     'combo.public',
     'combo.profile',
+    'combo.apps.assets',
     'combo.apps.dashboard',
+    'combo.apps.gallery',
+    'combo.apps.maps',
     'combo.apps.search',
     'panikombo',
-    'gallery',
+    'xstatic.pkg.leaflet',
+    'xstatic.pkg.leaflet_markercluster',
+    'xstatic.pkg.leaflet_gesturehandling',
 )
 
 CKEDITOR_UPLOAD_PATH = os.path.join(MEDIA_ROOT, 'uploads')
@@ -178,13 +183,11 @@ CKEDITOR_UPLOAD_PREFIX = '/media/uploads/'
 HAYSTACK_CONNECTIONS = {
     'default': {
         'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
-        'URL': 'http://127.0.0.1:8985/solr/panik'
+        'URL': 'http://127.0.0.1:8985/solr/panik',
     },
 }
 
-FIBER_TEMPLATE_CHOICES = (
-    ('tpl-default.html', 'Default template'),
-)
+FIBER_TEMPLATE_CHOICES = (('tpl-default.html', 'Default template'),)
 
 ENABLE_PIWIK = False
 
@@ -197,16 +200,12 @@ CACHES = {
 LOGGING = {
     'version': 1,
     'disable_existing_loggers': False,
-    'filters': {
-        'require_debug_false': {
-            '()': 'django.utils.log.RequireDebugFalse'
-        }
-    },
+    'filters': {'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}},
     'handlers': {
         'mail_admins': {
             'level': 'ERROR',
             'filters': ['require_debug_false'],
-            'class': 'django.utils.log.AdminEmailHandler'
+            'class': 'django.utils.log.AdminEmailHandler',
         }
     },
     'loggers': {
@@ -215,24 +214,14 @@ LOGGING = {
             'level': 'ERROR',
             'propagate': True,
         },
-    }
+    },
 }
 
 STATSD_CLIENT = 'django_statsd.clients.null'
 
 RAVEN_CONFIG = None
 
-DEBUG_TOOLBAR_PANELS = (
-    'debug_toolbar.panels.version.VersionDebugPanel',
-    'debug_toolbar.panels.timer.TimerDebugPanel',
-    'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
-    'debug_toolbar.panels.headers.HeaderDebugPanel',
-    'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
-    'debug_toolbar.panels.sql.SQLDebugPanel',
-    'debug_toolbar.panels.template.TemplateDebugPanel',
-    'debug_toolbar.panels.signals.SignalDebugPanel',
-    'debug_toolbar.panels.logger.LoggingPanel',
-)
+ACCESS_LOG_FILENAME = '/var/log/nginx/panikweb-access.log'
 
 from panikombo.misc import COMBO_PUBLIC_TEMPLATES
 
@@ -244,13 +233,42 @@ COMBO_DASHBOARD_ENABLED = False
 COMBO_MAP_TILE_URLTEMPLATE = ''
 COMBO_MAP_ATTRIBUTION = ''
 JSON_CELL_TYPES = {}
+COMBO_CELL_ASSET_SLOTS = {}
 
 RADIO_NAME = 'Radio Panik'
 RADIO_LONG_NAME = 'Radio Panik - 105.4 FM'
-WEBSITE_BASE_URL = 'http://www.radiopanik.org/'
+WEBSITE_BASE_URL = 'https://www.radiopanik.org/'
+PODCASTS_DEFAULT_IMAGE_PATH = '/static/img/logo-panik-500.png'
+RADIO_STREAM_URLS = [
+    {
+        'id': 'ogg',
+        'm3u_url': 'https://streaming.domainepublic.net/radiopanik.ogg.m3u',
+        'url': 'https://streaming.domainepublic.net/radiopanik.ogg',
+        'type': 'audio/ogg',
+    },
+    {
+        'id': 'mp3',
+        'm3u_url': 'https://streaming.domainepublic.net/radiopanik.mp3.m3u',
+        'url': 'https://streaming.domainepublic.net/radiopanik.mp3',
+        'type': 'audio/mpeg',
+    },
+]
+
+HOME_EMISSIONS_COUNT = 3
+HOME_FOCUS_COUNT = 3
+HOME_NEWSITEMS_COUNT = 3
+HOME_PODCASTS_COUNT = 3
+USE_AGENDA_ONLY_FIELD = False
+
+PROGRAM_PREFIX = 'programme/'
+EMISSIONS_PREFIX = 'emissions/'
+NEWSITEMS_PREFIX = 'actus/'
+
+THUMBNAIL_BACKEND = 'panikweb.utils.ThumbnailBackend'
 
 COMBO_INITIAL_LOGIN_PAGE_PATH = '/'
 COMBO_WELCOME_PAGE_PATH = None
+COMBO_CELL_TEMPLATES = {}
 
 local_settings_file = os.environ.get(
     'PANIKWEB_SETTINGS_FILE', os.path.join(os.path.dirname(__file__), 'local_settings.py')
@@ -259,30 +277,18 @@ if os.path.exists(local_settings_file):
     exec(open(local_settings_file).read())
 
 if DEBUG and DEBUG_TOOLBAR:
-    MIDDLEWARE_CLASSES += (
-        'debug_toolbar.middleware.DebugToolbarMiddleware',
-    )
-    INSTALLED_APPS += (
-        'debug_toolbar',
-    )
-
-    if 'template_timings_panel.panels.TemplateTimings.TemplateTimings' in DEBUG_TOOLBAR_PANELS:
-        INSTALLED_APPS += ('template_timings_panel',)
+    MIDDLEWARE += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
+    INSTALLED_APPS += ('debug_toolbar',)
 
 if ENABLE_PIWIK is False:
-    MIDDLEWARE_CLASSES = tuple([x for x in MIDDLEWARE_CLASSES \
-                                if x != 'panikweb.middleware.StripPiwikCookieMiddleware'])
+    MIDDLEWARE = tuple(x for x in MIDDLEWARE if x != 'panikweb.middleware.StripPiwikCookieMiddleware')
 
 if STATSD_CLIENT != 'django_statsd.clients.null':
-    MIDDLEWARE_CLASSES = (
-            'django_statsd.middleware.GraphiteRequestTimingMiddleware',
-            'django_statsd.middleware.GraphiteMiddleware',
-    ) + MIDDLEWARE_CLASSES
-    INSTALLED_APPS += (
-        'django_statsd',
-    )
+    MIDDLEWARE = (
+        'django_statsd.middleware.GraphiteRequestTimingMiddleware',
+        'django_statsd.middleware.GraphiteMiddleware',
+    ) + MIDDLEWARE
+    INSTALLED_APPS += ('django_statsd',)
 
 if RAVEN_CONFIG:
-    INSTALLED_APPS += (
-        'raven.contrib.django.raven_compat',
-    )
+    INSTALLED_APPS += ('raven.contrib.django.raven_compat',)