Return (generating first if needed) rendered template.
964235
def rendered(self):
        """"""
        if not self._rendered:
            template_path = get_template_path(self.raw_template_path)
            if template_path:
                with open(template_path, 'r') as template:
                    if len(os.path.splitext(template_path)) == 2 and (
                            os.path.splitext(template_path)[1] == '.j2'):
                        self._rendered = Template(template.read()).render(
                            context=self.context,
                            mappings=self.mappings,
                            name=self.name,
                            variables=self.resolved_variables
                        )
                    else:
                        self._rendered = template.read()
            else:
                raise InvalidConfig(
                    'Could not find template %s' % self.raw_template_path
                )

        return self._rendered
945178
def render(self, context):
        """"""

        content = mark_safe(self.get_content_from_context(context))
        if not content:
            return ''
        if self.parsed:
            try:
                t = template.Template(content, name=self.name)
                content = mark_safe(t.render(context))
            except TemplateSyntaxError as error:
                if global_settings.DEBUG:
                    content = PLACEHOLDER_ERROR % {
                        'name': self.name,
                        'error': error,
                    }
                else:
                    content = ''
        if self.as_varname is None:
            return content
        context[self.as_varname] = content
        return ''
48962
def render(self):
        """"""
        breadcrumb_template = template.loader.get_template(self.template)
        extra_context = {"breadcrumb": self}
        return breadcrumb_template.render(extra_context, self.request)
59946
def render(self, context, request=None):
        """"""
        context['component'] = self
        return render_to_string(self.template_name, context, request)
1235739
def format_template(template, content):
    """"""

    import pystache
    result = u""
    if True:  # try:
        result = pystache.render(template, content, string_encoding='utf-8')
    # except (ValueError, KeyError) as e:
    #    print("Templating error: %s %s" % (e, type(e)))

    # pprint(result)
    return result
1158496
def render_to_template(self):
        
        context_data = self.get_context_data()
        template = self.get_template()

        context_data['current_template'] = template.template.name
        return template.render(context_data)
1050872
def render(self):
        """"""
        engine = Engine()
        return engine.from_string(SUMMARY_TEMPLATE).render(Context(self.__dict__))
564986
def render(self, template, context_stack, delimiters=None):
        
        parsed_template = parse(template, delimiters)

        return parsed_template.render(self, context_stack)
87452
def generate_template(template_name, **context):
    """"""
    context.update(href=href, format_datetime=format_datetime)
    return template_loader.load(template_name).generate(**context)
487261
def direct_to_template(
        request, template, extra_context=None, mimetype=None, **kwargs):
    
    if extra_context is None:
        extra_context = {}
    dictionary = {'params': kwargs}
    for key, value in extra_context.items():
        if callable(value):
            dictionary[key] = value()
        else:
            dictionary[key] = value
    t = loader.get_template(template)
    return HttpResponse(
        t.render(context=dictionary, request=request),
        content_type=mimetype)
634090
def get_template(self):
        
        if self.template:
            return self.template

        template = None
        for p in self.get_ancestors(ascending=True):
            if p.template:
                template = p.template
                break

        if not template:
            template = settings.PAGE_DEFAULT_TEMPLATE

        return template
490849
def render_to_string(self, *args, **kwargs):
        """"""
        try:
            template_name, args = args[0], args[1:]
        except IndexError:
            raise TypeError('name of template required')
        return self.get_template(template_name).render(*args, **kwargs)
858538
def get_template(request, query, meta, proxyMode):
    """"""

    templateContent = None

    if not proxyMode:

        templateContent = plugIt.getTemplate(query, meta)

        if not templateContent:
            return (None, gen404(request, baseURI, 'template'))

    return (templateContent, None)
311276
def render(self, *args, **kwargs):
        """"""
        # args kwargs API provided for last minute content injection
        # self._reverse_mro_func('pre_render')
        pretty = kwargs.pop("pretty", False)
        if pretty and self._stable != "pretty":
            self._stable = False

        for arg in args:
            self._stable = False
            if isinstance(arg, dict):
                self.inject(arg)
        if kwargs:
            self._stable = False
            self.inject(kwargs)

        # If the tag or his contents are not changed and we already have rendered it
        # with the same attrs we skip all the work
        if self._stable and self._render:
            return self._render

        pretty_pre = pretty_inner = ""
        if pretty:
            pretty_pre = "\n" + ("\t" * self._depth) if pretty else ""
            pretty_inner = "\n" + ("\t" * self._depth) if len(self.childs) > 1 else ""
        inner = self.render_childs(pretty) if not self._void else ""

        # We declare the tag is stable and have an official render:
        tag_data = (
            pretty_pre,
            self._get__tag(),
            self.render_attrs(),
            inner,
            pretty_inner,
            self._get__tag()
        )[: 6 - [0, 3][self._void]]
        self._render = self._template % tag_data
        self._stable = "pretty" if pretty else True
        return self._render
1044299
def render_to_string(self, template_file, context):
        """"""
        context = context if context else {}
        if self.object:
            context['object'] = self.object
            context[self.object.__class__.__name__.lower()] = self.object
        return render_to_string(template_file, context, self.request)
263407
def render(self, template, context=None, def_name=None, subdir='templates', content_type=None, status=None, charset=None):
        ''''''
        template_adapter = self.get_template_loader(subdir).get_template(template)
        return getattr(template_adapter, 'render_to_response')(context=context, request=self.request, def_name=def_name, content_type=content_type, status=status, charset=charset)
1123004
def render_template(template_file, template_vars):
    """"""
    # Load our Jinja templates
    template_dir = "{0}/templates".format(
        os.path.dirname(os.path.abspath(__file__))
    )
    jinja_env = jinja2.Environment(
        loader=jinja2.FileSystemLoader(template_dir),
        trim_blocks=True
    )
    rendered = jinja_env.get_template(template_file).render(template_vars)

    return rendered