Migrate template settings to new Django version

This commit is contained in:
Sebastian Lohff 2019-10-15 23:49:29 +02:00
parent 0d1efce614
commit eb6462be50
1 changed files with 19 additions and 7 deletions

View File

@ -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/