From 434f19655032e6d6e42240fa0d2fbd4308dd79a4 Mon Sep 17 00:00:00 2001 From: Matjaz Gregoric <mtyaka@gmail.com> Date: Sun, 24 Jan 2016 19:31:39 +0100 Subject: [PATCH] Remove default django template loaders. Mako filesystem/app_directories loaders already wrap default django template loaders. Mako loaders delegate the `load_template_source` method to the base loader that they wrap, so there's no reason to explicitly include the two django loaders in the settings. --- common/djangoapps/edxmako/makoloader.py | 1 + lms/envs/common.py | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/common/djangoapps/edxmako/makoloader.py b/common/djangoapps/edxmako/makoloader.py index 994346a2ba0..cfe1915564e 100644 --- a/common/djangoapps/edxmako/makoloader.py +++ b/common/djangoapps/edxmako/makoloader.py @@ -19,6 +19,7 @@ class MakoLoader(object): This is a Django loader object which will load the template as a Mako template if the first line is "## mako". It is based off BaseLoader in django.template.loader. + We need this in order to be able to include mako templates inside main_django.html. """ is_usable = False diff --git a/lms/envs/common.py b/lms/envs/common.py index 68fcc3e6c77..33e41b6333b 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -472,12 +472,10 @@ TEMPLATES = [ # Options specific to this backend. 'OPTIONS': { 'loaders': [ + # We have to use mako-aware template loaders to be able to include + # mako templates inside django templates (such as main_django.html). 'edxmako.makoloader.MakoFilesystemLoader', 'edxmako.makoloader.MakoAppDirectoriesLoader', - - 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader', - ], 'context_processors': [ 'django.template.context_processors.request', -- GitLab