[damned-lies] Modernized settings as of Django 1.8
- From: Claude Paroz <claudep src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies] Modernized settings as of Django 1.8
- Date: Wed, 18 May 2016 19:10:38 +0000 (UTC)
commit fc60cd17598a98caa0c93e3e400b4ccf234d9ae6
Author: Claude Paroz <claude 2xlibre net>
Date: Wed May 18 20:49:42 2016 +0200
Modernized settings as of Django 1.8
damnedlies/settings.py | 48 +++++++++++++++++++++++++++---------------------
1 files changed, 27 insertions(+), 21 deletions(-)
---
diff --git a/damnedlies/settings.py b/damnedlies/settings.py
index 9766f00..bc07953 100644
--- a/damnedlies/settings.py
+++ b/damnedlies/settings.py
@@ -2,11 +2,9 @@
# Django settings for djamnedlies project.
import os
from django.conf import global_settings
-from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP
gettext_noop = lambda s: s
DEBUG = True
-TEMPLATE_DEBUG = DEBUG
STATIC_SERVE = True
USE_DEBUG_TOOLBAR = False
USE_DJANGO_OPENID = False
@@ -49,8 +47,6 @@ TIME_ZONE = 'Europe/Zurich'
LANGUAGE_CODE = 'en-US'
LANGUAGES = list(global_settings.LANGUAGES) + [
# Add here languages with translations for D-L but not for Django
- ('af', gettext_noop('Afrikaans')),
- ('be', gettext_noop('Belarusian')),
('ku', gettext_noop('Kurdish')),
]
@@ -94,18 +90,33 @@ LOGIN_URL = '/login/'
# To be filled in local_settings.py
SECRET_KEY = ''
-# List of callables that know how to import templates from various sources.
-TEMPLATE_LOADERS = (
- ('django.template.loaders.cached.Loader', (
- 'django.template.loaders.filesystem.Loader',
- 'django.template.loaders.app_directories.Loader',
- )),
-)
-
-TEMPLATE_CONTEXT_PROCESSORS = TCP + (
- "django.core.context_processors.request",
- "common.context_processors.utils",
-)
+TEMPLATES = [
+ {
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
+ 'DIRS': [os.path.join(BASE_DIR, 'templates')],
+ 'OPTIONS': {
+ 'context_processors': [
+ # Default list:
+ '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',
+ # Added processors:
+ 'django.template.context_processors.request',
+ 'common.context_processors.utils',
+ ],
+ 'loaders': [
+ ('django.template.loaders.cached.Loader', [
+ 'django.template.loaders.filesystem.Loader',
+ 'django.template.loaders.app_directories.Loader',
+ ]),
+ ],
+ },
+ },
+]
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
@@ -122,10 +133,6 @@ ATOMIC_REQUESTS = True
ROOT_URLCONF = 'damnedlies.urls'
-TEMPLATE_DIRS = (
- os.path.join(BASE_DIR, 'templates'),
-)
-
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
@@ -146,7 +153,6 @@ INSTALLED_APPS = (
INTERNAL_IPS=('127.0.0.1',)
-MESSAGE_STORAGE = 'django.contrib.messages.storage.fallback.FallbackStorage'
LOGIN_REDIRECT_URL = '/'
# Members of this group can edit all team's details and change team coordinatorship
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]