def __init__(self): file404 = utils.get_template_file('404.html') text = None if file404: text = file404.read() else: text = '<center><h1>404 Page Not Found</h1></center>' HttpResponse.__init__(self, content=text, status=404)
def render(self, context): self.context = context self.template = utils.get_template_file(self.template_name) output = '' if not self.template: #TODO raise exception return output try: output = self._text() except SyntaxError as ser: output = str(ser) return output