From eb6462be50a9ce45276e862e37964e8b30ed6132 Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Tue, 15 Oct 2019 23:49:29 +0200 Subject: [PATCH] Migrate template settings to new Django version --- dnmapper/settings.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/dnmapper/settings.py b/dnmapper/settings.py index 36ece10..1f3637b 100644 --- a/dnmapper/settings.py +++ b/dnmapper/settings.py @@ -13,7 +13,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__)) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production @@ -25,8 +26,6 @@ SECRET_KEY = 'crv*hfx2pkxvq1s!)dbz*hdu+r7u2$y4djf6_#6mm)shk9e!58' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -TEMPLATE_DEBUG = True - ALLOWED_HOSTS = [] STATICFILES_DIRS = ( @@ -60,6 +59,23 @@ MIDDLEWARE_CLASSES = ( ROOT_URLCONF = 'dnmapper.urls' +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [os.path.join(BASE_DIR, "templates/"), os.path.join(BASE_DIR, "bgpdata/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', + ], + }, + }, +] + + WSGI_APPLICATION = 'dnmapper.wsgi.application' @@ -85,10 +101,6 @@ USE_I18N = True USE_L10N = True USE_TZ = True -TEMPLATE_DIRS = ( - os.path.join(BASE_DIR, 'templates/'), -) - # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.7/howto/static-files/