Created
December 18, 2011 23:21
-
-
Save macalinao/1494796 to your computer and use it in GitHub Desktop.
404.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyramid.httpexceptions import HTTPNotFound | |
from pyramid.view import ( | |
AppendSlashNotFoundViewFactory, | |
view_config | |
) | |
def notfound_view(context, request): | |
return HTTPNotFound('It aint there, stop trying!') | |
custom_append_slash = AppendSlashNotFoundViewFactory(notfound_view) | |
custom_append_slash = view_config(custom_append_slash, context=HTTPNotFound) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment