Skip to content

Commit 3557f2b

Browse files
committed
Updated settings.py for Django 1.11
1 parent 65903b0 commit 3557f2b

1 file changed

Lines changed: 19 additions & 13 deletions

File tree

demo-django/demo/settings.py

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
1212
import os
13-
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
1413

14+
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
1515

1616
# Quick-start development settings - unsuitable for production
1717
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
@@ -22,11 +22,8 @@
2222
# SECURITY WARNING: don't run with debug turned on in production!
2323
DEBUG = True
2424

25-
TEMPLATE_DEBUG = True
26-
2725
ALLOWED_HOSTS = []
2826

29-
3027
# Application definition
3128

3229
INSTALLED_APPS = (
@@ -38,7 +35,7 @@
3835
'django.contrib.staticfiles',
3936
)
4037

41-
MIDDLEWARE_CLASSES = (
38+
MIDDLEWARE = (
4239
'django.contrib.sessions.middleware.SessionMiddleware',
4340
'django.middleware.common.CommonMiddleware',
4441
# 'django.middleware.csrf.CsrfViewMiddleware',
@@ -51,7 +48,6 @@
5148

5249
WSGI_APPLICATION = 'demo.wsgi.application'
5350

54-
5551
# Database
5652
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
5753

@@ -75,16 +71,26 @@
7571

7672
USE_TZ = True
7773

78-
79-
# Static files (CSS, JavaScript, Images)
80-
# https://docs.djangoproject.com/en/1.6/howto/static-files/
81-
8274
STATIC_URL = '/static/'
8375

8476
SAML_FOLDER = os.path.join(BASE_DIR, 'saml')
8577

8678
SESSION_ENGINE = 'django.contrib.sessions.backends.file'
8779

88-
TEMPLATE_DIRS = (
89-
os.path.join(BASE_DIR, 'templates'),
90-
)
80+
TEMPLATES = [
81+
{
82+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
83+
'DIRS': [os.path.join(BASE_DIR, 'templates')]
84+
,
85+
'APP_DIRS': True,
86+
'OPTIONS': {
87+
'debug': True,
88+
'context_processors': [
89+
'django.template.context_processors.debug',
90+
'django.template.context_processors.request',
91+
'django.contrib.auth.context_processors.auth',
92+
'django.contrib.messages.context_processors.messages',
93+
],
94+
},
95+
},
96+
]

0 commit comments

Comments
 (0)