Browse Source

Migrate template settings to new Django version

Sebastian Lohff 8 months ago
parent
commit
eb6462be50
1 changed files with 19 additions and 7 deletions
  1. 19
    7
      dnmapper/settings.py

+ 19
- 7
dnmapper/settings.py View File

@@ -13,7 +13,8 @@ https://docs.djangoproject.com/en/1.7/ref/settings/
13 13
 
14 14
 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
15 15
 import os
16
-BASE_DIR = os.path.dirname(os.path.dirname(__file__))
16
+# BASE_DIR = os.path.dirname(os.path.dirname(__file__))
17
+BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17 18
 
18 19
 
19 20
 # Quick-start development settings - unsuitable for production
@@ -25,8 +26,6 @@ SECRET_KEY = 'crv*hfx2pkxvq1s!)dbz*hdu+r7u2$y4djf6_#6mm)shk9e!58'
25 26
 # SECURITY WARNING: don't run with debug turned on in production!
26 27
 DEBUG = True
27 28
 
28
-TEMPLATE_DEBUG = True
29
-
30 29
 ALLOWED_HOSTS = []
31 30
 
32 31
 STATICFILES_DIRS = (
@@ -60,6 +59,23 @@ MIDDLEWARE_CLASSES = (
60 59
 
61 60
 ROOT_URLCONF = 'dnmapper.urls'
62 61
 
62
+TEMPLATES = [
63
+    {
64
+        'BACKEND': 'django.template.backends.django.DjangoTemplates',
65
+        'DIRS': [os.path.join(BASE_DIR, "templates/"), os.path.join(BASE_DIR, "bgpdata/templates")],
66
+        'APP_DIRS': True,
67
+        'OPTIONS': {
68
+            'context_processors': [
69
+                'django.template.context_processors.debug',
70
+                'django.template.context_processors.request',
71
+                'django.contrib.auth.context_processors.auth',
72
+                'django.contrib.messages.context_processors.messages',
73
+            ],
74
+        },
75
+    },
76
+]
77
+
78
+
63 79
 WSGI_APPLICATION = 'dnmapper.wsgi.application'
64 80
 
65 81
 
@@ -85,10 +101,6 @@ USE_I18N = True
85 101
 USE_L10N = True
86 102
 
87 103
 USE_TZ = True
88
-TEMPLATE_DIRS = (
89
-	os.path.join(BASE_DIR, 'templates/'),
90
-)
91
-
92 104
 
93 105
 # Static files (CSS, JavaScript, Images)
94 106
 # https://docs.djangoproject.com/en/1.7/howto/static-files/

Loading…
Cancel
Save