How to use the jinja.Template function in Jinja

To help you get started, we’ve selected a few Jinja examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jedie / python-code-snippets / CodeSnippets / PyDown / branches / v0.4 / PyDown / PyDown.py View on Github external
def render(self, templatename):
        """
        Template mit jinja rendern, dabei wird self.request.context verwendet
        """
        #~ loader = jinja.FileSystemLoader('templates')
        loader = jinja.CachedFileSystemLoader('templates')

        template = jinja.Template(templatename, loader)
        context = jinja.Context(self.request.context)

        self.request.write(template.render(context))

        if cfg["debug"]: self.request.debug_info()