]> git.0d.be Git - panikdb.git/blobdiff - panikdb/settings.py
settings: add new COMBO_MAP_ required settings
[panikdb.git] / panikdb / settings.py
index a98ad39d3de062e93cd09f396fca599c9cea99be..1c4eaff6da93bbc7ae09f6eb811aa741122826f9 100644 (file)
@@ -1,10 +1,14 @@
 # Django settings for panikdb project.
+# coding: utf-8
 
+import copy
 import os
+from django.conf import global_settings
 
 DEBUG = True
-TEMPLATE_DEBUG = DEBUG
+DEBUG_TOOLBAR = True
 
+PROJECT_DIR = os.path.normpath(os.path.dirname(os.path.dirname(__file__)))
 PROJECT_PATH = os.path.dirname(os.path.dirname(__file__))
 
 ADMINS = (
@@ -40,6 +44,8 @@ SITE_ID = 1
 # to load the internationalization machinery.
 USE_I18N = True
 
+LOCALE_PATHS = (os.path.join(PROJECT_DIR, 'panikdb', 'locale'),)
+
 # If you set this to False, Django will not format dates, numbers and
 # calendars according to the current locale.
 USE_L10N = True
@@ -54,7 +60,7 @@ MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media')
 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
 # trailing slash.
 # Examples: "http://example.com/media/", "http://media.example.com/"
-MEDIA_URL = ''
+MEDIA_URL = '/media/'
 
 # Absolute path to the directory static files should be collected to.
 # Don't put anything in this directory yourself; store your static files
@@ -66,7 +72,10 @@ STATIC_ROOT = os.path.join(PROJECT_PATH, 'static')
 # Example: "http://example.com/static/", "http://static.example.com/"
 STATIC_URL = '/static/'
 
-CKEDITOR_UPLOAD_PATH = os.path.join(MEDIA_ROOT, 'uploads')
+SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
+
+CKEDITOR_UPLOAD_PATH = 'uploads/'
+CKEDITOR_UPLOAD_PREFIX = '/media/uploads/'
 
 # Additional locations of static files
 STATICFILES_DIRS = (
@@ -78,21 +87,37 @@ STATICFILES_DIRS = (
 
 # List of finder classes that know how to find static files in
 # various locations.
-STATICFILES_FINDERS = (
-    'django.contrib.staticfiles.finders.FileSystemFinder',
-    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
-#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
-)
+STATICFILES_FINDERS = list(global_settings.STATICFILES_FINDERS) + \
+            ['gadjo.finders.XStaticFinder']
 
 # Make this unique, and don't share it with anybody.
 SECRET_KEY = '(jwx-1y#d#vps93glikirr&tq_!^_4g+9-qj(jy#l=sllqw(^j'
 
-# List of callables that know how to import templates from various sources.
-TEMPLATE_LOADERS = (
-    'django.template.loaders.filesystem.Loader',
-    'django.template.loaders.app_directories.Loader',
-#     'django.template.loaders.eggs.Loader',
-)
+TEMPLATES = [
+    {
+        'BACKEND': 'django.template.backends.django.DjangoTemplates',
+        'DIRS': [
+            os.path.join(PROJECT_PATH, 'panikdb', 'templates'),
+        ],
+        'APP_DIRS': True,
+        'OPTIONS': {
+            'context_processors': [
+                'django.template.context_processors.request',
+                'django.contrib.auth.context_processors.auth',
+                'django.template.context_processors.debug',
+                'django.template.context_processors.i18n',
+                'django.template.context_processors.media',
+                'django.template.context_processors.static',
+                'django.template.context_processors.tz',
+                'django.contrib.messages.context_processors.messages',
+                'panikdb.context_processors.internal_ip',
+                'panikdb.context_processors.site_settings',
+            ],
+        },
+    },
+]
+
+
 
 MIDDLEWARE_CLASSES = (
     'django.middleware.common.CommonMiddleware',
@@ -109,10 +134,6 @@ ROOT_URLCONF = 'panikdb.urls'
 # Python dotted path to the WSGI application used by Django's runserver.
 WSGI_APPLICATION = 'panikdb.wsgi.application'
 
-TEMPLATE_DIRS = (
-    os.path.join(PROJECT_PATH, 'panikdb', 'templates'),
-)
-
 INSTALLED_APPS = (
     'django.contrib.auth',
     'django.contrib.contenttypes',
@@ -121,8 +142,30 @@ INSTALLED_APPS = (
     'django.contrib.messages',
     'django.contrib.staticfiles',
     'django.contrib.admin',
+    'registration',
     'ckeditor',
-    'panikdb.emissions',
+    'haystack',
+    'taggit',
+    'emissions',
+    'newsletter',
+    'matos',
+    'nonstop',
+    'panikdb.aa',
+    'panikdb.customtags',
+    'panikdb.stats',
+    'panikdb.poll',
+    'gadjo',
+    'combo.data',
+    'combo.manager',
+    'combo.apps.assets',
+    'combo.apps.gallery',
+    'combo.apps.maps',
+    'combo.apps.notifications',
+    'combo.apps.pwa',
+    'sorl.thumbnail',
+    'panikombo',
+    'django_select2',
+    'xstatic.pkg.select2',
 )
 
 # A sample logging configuration. The only tangible logging
@@ -156,12 +199,89 @@ LOGGING = {
 
 CKEDITOR_CONFIGS = {
     'default': {
-        'toolbar': 'Basic',
+        'allowedContent': True,
+        'filebrowserUploadUrl': '/ckeditor/upload/',
+        'filebrowserBrowseUrl': '/ckeditor/browse/',
+        'toolbar_Own': [['Source', 'Format', '-', 'Bold', 'Italic'],
+                        ['NumberedList','BulletedList'],
+                        ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
+                        ['Link', 'Unlink'],
+                        ['Image',],
+                        ['RemoveFormat',]],
+        'toolbar': 'Own',
+    },
+}
+
+CKEDITOR_CONFIGS['small'] = copy.copy(CKEDITOR_CONFIGS['default'])
+CKEDITOR_CONFIGS['small']['height'] = 150
+
+HAYSTACK_CONNECTIONS = {
+    'default': {
+        'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
+        'URL': 'http://127.0.0.1:8985/solr/panik'
     },
 }
 
+CACHES = {
+    'default': {
+        'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
+    },
+}
+
+TEST_RUNNER = 'django.test.runner.DiscoverRunner'
+
+AUTH_USER_MODEL = 'aa.User'
+LOGIN_REDIRECT_URL = '/'
+WEBSITE_BASE_URL = 'http://www.radiopanik.org/'
+
+NEWSLETTER_SENDER = 'info@radiopanik.org'
+NEWSLETTER_DOMAIN = 'radiopanik.org'
+NEWSLETTER_STYLE = """
+body { color: #222; text-align: justify; }
+h2, h3 { font-family: "Reglo"; }
+h3 { margin-bottom: 0; }
+h3 + p { margin-top: 0; }
+p strong { color: black; }
+h3 strong { text-transform: uppercase; color: blue; }
+p a { color: black; text-decoration: none; border-bottom: 1px dotted black; }
+p a:hover { border-bottom: 1px solid black; }
+"""
+
+RAVEN_CONFIG = None
+
+from panikombo.misc import COMBO_PUBLIC_TEMPLATES
+COMBO_DEFAULT_PUBLIC_TEMPLATE = 'standard'
+COMBO_MAP_TILE_URLTEMPLATE = ''
+COMBO_MAP_ATTRIBUTION = ''
+
+AUTO_RENDER_SELECT2_STATICS = False
+
+PIGE_DOWNLOAD_BASE_URL = 'http://pige.panik/extractor/download.cgi'
+
+JSON_CELL_TYPES = {}
+TEMPLATE_VARS = {}
+
+FILE_UPLOAD_DIRECTORY_PERMISSIONS = 0o755
+FILE_UPLOAD_PERMISSIONS = 0o644
+
+ENABLE_TOPIKS = True
+HAS_SOMA = False
+SITE_TITLE = 'PanikDB'
 
 try:
-    from local_settings import *
+    from .local_settings import *
 except ImportError:
     pass
+
+if DEBUG and DEBUG_TOOLBAR:
+    MIDDLEWARE_CLASSES += (
+        'debug_toolbar.middleware.DebugToolbarMiddleware',
+    )
+    INSTALLED_APPS += (
+        'debug_toolbar',
+    )
+
+if RAVEN_CONFIG:
+    INSTALLED_APPS += (
+        'raven.contrib.django.raven_compat',
+    )