﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
25788	Enable the cached template loader when DEBUG=False if no loaders are explicitly configured	Jaap Roes	Harris Lapiroff	"Currently enabling the cached template loader is a lot of effort, you'll have to change your settings from something like this:

{{{
TEMPLATES = [{
    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': [os.path.join(BASE_DIR, 'templates')],
    'APP_DIRS': True
}]
}}}

To this:

{{{
TEMPLATES = [{
    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': [os.path.join(BASE_DIR, 'templates')],
    'OPTIONS': {
        'loaders': [
            ('django.template.loaders.cached.Loader', [
                'django.template.loaders.filesystem.Loader',
                'django.template.loaders.app_directories.Loader',
            ]),
        ],
    },
}]
}}}

Making sure you don't forget to take out the `APP_DIRS` option, figuring out what loaders to use and getting the nesting of tuples and lists just right.

I propose adding an option the Django template engine called `cache_templates` to simplify all of this. Making the second example look more like this:

{{{
TEMPLATES = [{
    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': [os.path.join(BASE_DIR, 'templates')],
    'APP_DIRS': True
    'OPTIONS': {'cache_templates': DEBUG}
}]
}}}"	New feature	closed	Template system	dev	Normal	fixed			Ready for checkin	1	0	0	0	0	0
