From 047394ea8ee37fb9161e8dad7693e82112f40d31 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 25 Nov 2018 03:36:51 -0800 Subject: Add import and return a Page object for the notfound view --- docs/tutorials/wiki/src/views/tutorial/views/notfound.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'docs/tutorials/wiki') diff --git a/docs/tutorials/wiki/src/views/tutorial/views/notfound.py b/docs/tutorials/wiki/src/views/tutorial/views/notfound.py index 728791d0a..214ec810e 100644 --- a/docs/tutorials/wiki/src/views/tutorial/views/notfound.py +++ b/docs/tutorials/wiki/src/views/tutorial/views/notfound.py @@ -1,7 +1,12 @@ from pyramid.view import notfound_view_config +from ..models import Page + @notfound_view_config(renderer='../templates/404.pt') def notfound_view(request): request.response.status = 404 - return {} + pagename = request.subpath + page = Page(pagename) + page.__name__ = pagename + return dict(page=page) -- cgit v1.2.3