1class Renderer(object): 2 def __init__(self, **kwargs): 3 super(Renderer, self).__init__() 4 5 def render(self, loader, template, **kwargs): 6 t = loader.get_template(template) 7 post = kwargs.pop("post", lambda result: result) 8 r = t.render(loader=loader, **kwargs) 9 return post(r) 10