def render_page(filename, response, context): context["logged_in"] = get_login(response) if context["logged_in"]: user = User.find(context["logged_in"]) context["user"] = user if "query" not in context: context["query"] = None if "tags" not in context: context["tags"] = None html = render(filename, context) response.write(html)
def check_login(self, *args, **kwargs): if self.username is not None and self.login_required: self.redirect("/account/profile") else: file = render(self.template_name + '.html', self.extra_context(*args, **kwargs)) self.write(file)
def eval(self, context): from template.render import render read_file = render(self.reference, context) return read_file