Fixed #4278 -- The `TEMPLATE_DIRS` setting can be overridden by loader.get_template() and loader.select_template().