]> git.0d.be Git - panikdb.git/commitdiff
settings: update for django 1.11
authorFrédéric Péters <fpeters@0d.be>
Fri, 9 Feb 2018 14:39:37 +0000 (15:39 +0100)
committerFrédéric Péters <fpeters@0d.be>
Fri, 9 Feb 2018 14:39:37 +0000 (15:39 +0100)
panikdb/settings.py

index 05c17f27f7e3e87b0bb39c9db043241123690fa1..f1c1100ce6043220dfca1a334004a900a45a7fd1 100644 (file)
@@ -5,7 +5,6 @@ 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__)))
@@ -85,18 +84,35 @@ STATICFILES_DIRS = (
 
 # List of finder classes that know how to find static files in
 # various locations.
-STATICFILES_FINDERS = global_settings.STATICFILES_FINDERS + \
-            ('gadjo.finders.XStaticFinder',)
+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.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',
+            ],
+        },
+    },
+]
+
+
 
 MIDDLEWARE_CLASSES = (
     'django.middleware.common.CommonMiddleware',
@@ -113,10 +129,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',
@@ -237,9 +249,6 @@ PIGE_DOWNLOAD_BASE_URL = 'http://pige.panik/extractor/download.cgi'
 
 JSON_CELL_TYPES = {}
 
-TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + \
-            ('panikdb.context_processors.internal_ip',)
-
 FILE_UPLOAD_DIRECTORY_PERMISSIONS = 0o755
 FILE_UPLOAD_PERMISSIONS = 0o644