# HG changeset patch # User Jeff Hammel # Date 1345789147 25200 # Node ID 12ee37017538a439ed2f6d4c6b9cc33a5f6f4618 # Parent 32d7286adfa526604d0d60f32db2a17160c29eac introduce templated 404s; works, just doesnt do anything yet diff -r 32d7286adfa5 -r 12ee37017538 decoupage/templates/HTTPNotFound.html --- a/decoupage/templates/HTTPNotFound.html Thu Aug 23 22:03:47 2012 -0700 +++ b/decoupage/templates/HTTPNotFound.html Thu Aug 23 23:19:07 2012 -0700 @@ -4,11 +4,13 @@ - +
+

404 Not Found

+
diff -r 32d7286adfa5 -r 12ee37017538 decoupage/web.py --- 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)