From 8949b1ffded179db82edc26f8d05c5ef14446702 Mon Sep 17 00:00:00 2001 From: jberends Date: Mon, 29 Aug 2016 14:58:47 +0200 Subject: [PATCH] Refactored the settings of the demo to confirm to the use of TEMPLATE_* settings in django. --- demo/demo/settings.py | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/demo/demo/settings.py b/demo/demo/settings.py index f559d5c..a41f5b2 100644 --- a/demo/demo/settings.py +++ b/demo/demo/settings.py @@ -10,8 +10,8 @@ https://docs.djangoproject.com/en/1.7/ref/settings/ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os -BASE_DIR = os.path.dirname(os.path.dirname(__file__)) +BASE_DIR = os.path.dirname(os.path.dirname(__file__)) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ @@ -22,19 +22,8 @@ SECRET_KEY = 'ma3c@7uu!%e0=tynp+i6+q%$)9v@$t(eulqurym_b=48z82&5n' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -TEMPLATE_DEBUG = True - ALLOWED_HOSTS = [] -TEMPLATE_CONTEXT_PROCESSORS = ( - 'django.contrib.auth.context_processors.auth', - "django.core.context_processors.request", - - # Disabling due to alluth>=0.21.0 changes - # "allauth.account.context_processors.account", - # "allauth.socialaccount.context_processors.socialaccount", -) - # Application definition INSTALLED_APPS = ( @@ -71,7 +60,6 @@ ROOT_URLCONF = 'demo.urls' WSGI_APPLICATION = 'demo.wsgi.application' - # Database # https://docs.djangoproject.com/en/1.7/ref/settings/#databases @@ -95,13 +83,28 @@ USE_L10N = True USE_TZ = True - # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.7/howto/static-files/ STATIC_URL = '/static/' -TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')] +# TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')] + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [os.path.join(BASE_DIR, 'templates'), ], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] REST_SESSION_LOGIN = False EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'