'Returns a new template loader for the given path.
May be overridden by subclasses.  By default returns a
directory-based loader on the given path, using the
``autoescape`` application setting.  If a ``template_loader``
application setting is supplied, uses that instead.'

def create_template_loader(self, template_path):

    settings = self.application.settings
    if ('template_loader' in settings):
        return settings['template_loader']
    kwargs = {}
    if ('autoescape' in settings):
        kwargs['autoescape'] = settings['autoescape']
    return template.Loader(template_path, **kwargs)
