def __init__(self, template_name, context, *args, **kwargs): if "content_type" not in kwargs: kwargs["content_type"] = content_type(template_name) self.template = self.env.get_template(template_name) self.context = context super(TemplateResponse, self).__init__(None, *args, **kwargs)