def load_template_source(self, template_name, template_dirs=None): (source, filepath) = super(Loader, self).load_template_source(template_name, template_dirs) if getattr(settings, "TEMPLATE_MINIFIER", True): return (get_template_minifier_strip_function()(source), filepath) else: return (source, filepath)
def load_template_source(self, template_name, template_dirs=None): (source, filepath) = super(Loader, self).load_template_source(template_name, template_dirs) if getattr(settings, 'TEMPLATE_MINIFIER', True): return (get_template_minifier_strip_function()(source), filepath) else: return (source, filepath)
def load_template_source(self, template_name, template_dirs=None): (source, filepath) = super(Loader, self).load_template_source(template_name, template_dirs) SETTINGS_TEMPLATE_MINIFIER = getattr(settings, 'TEMPLATE_MINIFIER', True) SETTINGS_TEMPLATE_MINIFIER_EXCLUDE = getattr(settings, 'TEMPLATE_MINIFIER_EXCLUDE', []) if SETTINGS_TEMPLATE_MINIFIER and template_name not in SETTINGS_TEMPLATE_MINIFIER_EXCLUDE: return ( get_template_minifier_strip_function()(source), filepath ) else: return ( source, filepath )
def get_contents(self, origin): contents = super(Loader, self).get_contents(origin) if getattr(settings, 'TEMPLATE_MINIFIER', True): return get_template_minifier_strip_function()(contents) else: return contents