[extensions-web/django/upgrade-1.8] django: fixed warning 1_8.W001: standalone TEMPLATE_* settings deprecated.
- From: Yuri Konotopov <ykonotopov src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web/django/upgrade-1.8] django: fixed warning 1_8.W001: standalone TEMPLATE_* settings deprecated.
- Date: Wed, 26 Oct 2016 21:49:15 +0000 (UTC)
commit 80d3d12e0a78ce6a69beef61a49976d6dbf69a60
Author: Yuri Konotopov <ykonotopov gnome org>
Date: Wed Oct 26 23:27:50 2016 +0300
django: fixed warning 1_8.W001: standalone TEMPLATE_* settings deprecated.
sweettooth/settings.py | 47 +++++++++++++++++++++--------------------------
1 files changed, 21 insertions(+), 26 deletions(-)
---
diff --git a/sweettooth/settings.py b/sweettooth/settings.py
index 0ddec88..9839ada 100644
--- a/sweettooth/settings.py
+++ b/sweettooth/settings.py
@@ -3,7 +3,6 @@
import os
DEBUG = False
-TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Jasper St. Piere', 'jstpierre mecheye net'),
@@ -13,6 +12,27 @@ MANAGERS = ADMINS
SITE_ROOT = os.path.dirname(os.path.abspath(__file__))
+TEMPLATES = [
+ {
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
+ 'DIRS': [os.path.join(SITE_ROOT, 'templates')],
+ 'APP_DIRS': True,
+ 'OPTIONS': {
+ '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.request",
+ "django.contrib.messages.context_processors.messages",
+ "sweettooth.review.context_processors.n_unreviewed_extensions",
+ "sweettooth.auth.context_processors.login_form",
+ ],
+ 'debug': DEBUG,
+ },
+ },
+]
+
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
@@ -69,13 +89,6 @@ STATICFILES_DIRS = (
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'tv(d+lom-sa^de5i#ab)(g^3249tbzssizuvh8m9_lwppdn1bw'
-# 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',
-)
-
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
@@ -86,24 +99,6 @@ MIDDLEWARE_CLASSES = (
ROOT_URLCONF = 'sweettooth.urls'
-TEMPLATE_DIRS = (
- # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
- # Always use forward slashes, even on Windows.
- # Don't forget to use absolute paths, not relative paths.
- os.path.join(SITE_ROOT, 'templates'),
-)
-
-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.request",
- "django.contrib.messages.context_processors.messages",
- "sweettooth.review.context_processors.n_unreviewed_extensions",
- "sweettooth.auth.context_processors.login_form",
-)
-
ACCOUNT_ACTIVATION_DAYS = 5
LOGIN_URL = '/accounts/login/'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]