]> git.0d.be Git - panikweb.git/blobdiff - panikweb/settings.py
move static & templates to panikweb project directory
[panikweb.git] / panikweb / settings.py
index 3444f8f88a1f68c13cc4898485a63b713e0026d6..9bcb2fc12481820f65479ce7b042bb95d82f7cf5 100644 (file)
@@ -6,8 +6,7 @@ import os
 import django.conf.global_settings as DEFAULT_SETTINGS
 
 DEBUG = True  # Turn off for production
-TEMPLATE_DEBUG = DEBUG
-DEBUG_TOOLBAR = True
+DEBUG_TOOLBAR = False
 
 PROJECT_DIR = os.path.normpath(os.path.dirname(os.path.dirname(__file__)))
 ADMINS = (
@@ -47,6 +46,7 @@ LANGUAGE_CODE = 'fr-be'
 
 LANGUAGES = (
   ('fr', u'Français'),
+  ('en', u'English'),
 )
 
 SITE_ID = 1
@@ -55,6 +55,8 @@ SITE_ID = 1
 # to load the internationalization machinery.
 USE_I18N = True
 
+LOCALE_PATHS = (os.path.join(PROJECT_DIR, 'panikweb', 'locale'),)
+
 # Absolute filesystem path to the directory that will hold user-uploaded files.
 # Example: "/home/media/media.lawrence.com/media/"
 MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media')
@@ -86,38 +88,52 @@ STATICFILES_DIRS = (
 STATICFILES_FINDERS = (
     'django.contrib.staticfiles.finders.FileSystemFinder',
     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
-    'compressor.finders.CompressorFinder',
+    'gadjo.finders.XStaticFinder',
 #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
 )
 
+
 # Make this unique, and don't share it with anybody.
 SECRET_KEY = '3qm&@6264-=st16)7_xa*ds+31e0mqqs@+*!ud7gzt$tq!b^qn'
 
-# 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.load_template_source',
-)
-
 MIDDLEWARE_CLASSES = (
     'django.middleware.cache.UpdateCacheMiddleware',
-    'django.middleware.gzip.GZipMiddleware',
+    #'django.middleware.gzip.GZipMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
+    'django.middleware.locale.LocaleMiddleware',
     'django.middleware.common.CommonMiddleware',
     'django.middleware.csrf.CsrfViewMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware',
-    'fiber.middleware.ObfuscateEmailAddressMiddleware',
-    'fiber.middleware.AdminPageMiddleware',
     #'request.middleware.RequestMiddleware',
     'panikweb.middleware.StripPiwikCookieMiddleware',
     'django.middleware.cache.FetchFromCacheMiddleware',
 )
 
-TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_SETTINGS.TEMPLATE_CONTEXT_PROCESSORS + (
-    'django.core.context_processors.request',
-)
+TEMPLATES = [
+    {
+        'BACKEND': 'django.template.backends.django.DjangoTemplates',
+        'DIRS': [
+            os.path.join(PROJECT_DIR, 'panikweb', 'templates'),
+        ],
+        'APP_DIRS': True,
+        'OPTIONS': {
+            'context_processors': [
+                '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.request',
+                'django.template.context_processors.static',
+                'django.template.context_processors.tz',
+                'panikweb.context_processors.panikweb',
+            ],
+            'builtins': [
+                'combo.public.templatetags.combo',
+            ],
+        },
+    },
+]
 
 
 ROOT_URLCONF = 'panikweb.urls'
@@ -137,18 +153,23 @@ INSTALLED_APPS = (
     'django.contrib.staticfiles',
     'django.contrib.admin',
     'django.contrib.admindocs',
-    'south',
     'haystack',
     'taggit',
-    'panikweb_templates',
+    'gadjo',
     'panikweb.paniktags',
-    'mptt',
-    'compressor',
-    'fiber',
-    'jquery',
+    'sorl.thumbnail',
     'ckeditor',
     'emissions',
     'newsletter',
+    'nonstop',
+    'combo.data',
+    'combo.public',
+    'combo.profile',
+    'combo.apps.assets',
+    'combo.apps.dashboard',
+    'combo.apps.gallery',
+    'combo.apps.search',
+    'panikombo',
 )
 
 CKEDITOR_UPLOAD_PATH = os.path.join(MEDIA_ROOT, 'uploads')
@@ -199,6 +220,8 @@ LOGGING = {
 
 STATSD_CLIENT = 'django_statsd.clients.null'
 
+RAVEN_CONFIG = None
+
 DEBUG_TOOLBAR_PANELS = (
     'debug_toolbar.panels.version.VersionDebugPanel',
     'debug_toolbar.panels.timer.TimerDebugPanel',
@@ -211,10 +234,30 @@ DEBUG_TOOLBAR_PANELS = (
     'debug_toolbar.panels.logger.LoggingPanel',
 )
 
-try:
-    from local_settings import *
-except ImportError, e:
-    pass
+from panikombo.misc import COMBO_PUBLIC_TEMPLATES
+
+LANGUAGE_COOKIE_NAME = 'panikweb_language'
+
+TEMPLATE_VARS = {}
+
+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/'
+
+COMBO_INITIAL_LOGIN_PAGE_PATH = '/'
+COMBO_WELCOME_PAGE_PATH = None
+
+local_settings_file = os.environ.get(
+    'PANIKWEB_SETTINGS_FILE', os.path.join(os.path.dirname(__file__), 'local_settings.py')
+)
+if os.path.exists(local_settings_file):
+    exec(open(local_settings_file).read())
 
 if DEBUG and DEBUG_TOOLBAR:
     MIDDLEWARE_CLASSES += (
@@ -223,9 +266,6 @@ if DEBUG and DEBUG_TOOLBAR:
     INSTALLED_APPS += (
         'debug_toolbar',
     )
-    DEBUG_TOOLBAR_CONFIG = {
-        'INTERCEPT_REDIRECTS': False,
-    }
 
     if 'template_timings_panel.panels.TemplateTimings.TemplateTimings' in DEBUG_TOOLBAR_PANELS:
         INSTALLED_APPS += ('template_timings_panel',)
@@ -239,3 +279,11 @@ if STATSD_CLIENT != 'django_statsd.clients.null':
             'django_statsd.middleware.GraphiteRequestTimingMiddleware',
             'django_statsd.middleware.GraphiteMiddleware',
     ) + MIDDLEWARE_CLASSES
+    INSTALLED_APPS += (
+        'django_statsd',
+    )
+
+if RAVEN_CONFIG:
+    INSTALLED_APPS += (
+        'raven.contrib.django.raven_compat',
+    )