Mercurial > hg > decoupage
diff decoupage/web.py @ 73:12ee37017538
introduce templated 404s; works, just doesnt do anything yet
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 23 Aug 2012 23:19:07 -0700 |
parents | 262fb90a54b4 |
children | dd7d385e11ea |
line wrap: on
line diff
--- a/decoupage/web.py Thu Aug 23 22:03:47 2012 -0700 +++ b/decoupage/web.py Thu Aug 23 23:19:07 2012 -0700 @@ -135,7 +135,12 @@ return fileserver(environ, start_response) else: # file does not exist - response = exc.HTTPNotFound() + conf = self.conf('/') + data = dict(request=request, + title="Not Found") + template = self.loader.load('HTTPNotFound.html') + body = template.generate(**data).render('html', doctype='html') + response = Response(content_type='text/html', body=body, status=404) return response(environ, start_response)