Просмотр исходного кода

Upgrade settings to contain TEMPLATES (introduced in Django 1.8)

TheKit 8 лет назад
Родитель
Сommit
b6d482b868
2 измененных файлов с 17 добавлено и 10 удалено
  1. 5 5
      misago/conf/defaults.py
  2. 12 5
      misago/project_template/project_name/settings.py

+ 5 - 5
misago/conf/defaults.py

@@ -84,11 +84,11 @@ MIDDLEWARE_CLASSES = (
 
 TEMPLATE_CONTEXT_PROCESSORS = (
     'django.contrib.auth.context_processors.auth',
-    'django.core.context_processors.debug',
-    'django.core.context_processors.i18n',
-    'django.core.context_processors.media',
-    'django.core.context_processors.static',
-    'django.core.context_processors.tz',
+    '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',
 
     'misago.core.context_processors.site_address',

+ 12 - 5
misago/project_template/project_name/settings.py

@@ -23,8 +23,6 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 # SECURITY WARNING: don't run with debug turned on in production!
 DEBUG = True
 
-TEMPLATE_DEBUG = DEBUG
-
 # Hosts allowed to POST to your site
 # If you are unsure, just enter here your host name, eg. 'mysite.com'
 
@@ -96,9 +94,18 @@ STATICFILES_DIRS = (
     os.path.join(BASE_DIR, 'theme', 'static'),
 )
 
-TEMPLATE_DIRS = (
-    os.path.join(BASE_DIR, 'theme', 'templates'),
-)
+TEMPLATES = [
+    {
+        'BACKEND': 'django.template.backends.django.DjangoTemplates',
+        'DIRS': [
+            os.path.join(BASE_DIR, 'theme', 'templates'),
+        ],
+        'APP_DIRS': True,
+        'OPTIONS': {
+            'context_processors': TEMPLATE_CONTEXT_PROCESSORS,
+        },
+    },
+]
 
 
 # SECURITY WARNING: keep the secret key used in production secret!