Skip to content

Instantly share code, notes, and snippets.

@nara-l
Last active June 1, 2018 00:46
Show Gist options
  • Save nara-l/994e50906abad7f8ccfc96f77da81532 to your computer and use it in GitHub Desktop.
Save nara-l/994e50906abad7f8ccfc96f77da81532 to your computer and use it in GitHub Desktop.
Django 1.11 template settings config
# Build path
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, "templates")],
'OPTIONS': {
'loaders': (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
),
'context_processors': [
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.debug',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.template.context_processors.request',
'django.contrib.messages.context_processors.messages',
],
'debug': DEBUG
},
},
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment