Skip to content

Instantly share code, notes, and snippets.

@macalinao
Created December 18, 2011 21:15
Show Gist options
  • Save macalinao/1494486 to your computer and use it in GitHub Desktop.
Save macalinao/1494486 to your computer and use it in GitHub Desktop.
from pyramid.httpexceptions import HTTPNotFound
from pyramid.view import AppendSlashNotFoundViewFactory
def notfound_view(context, request):
return HTTPNotFound('It aint there, stop trying!')
custom_append_slash = AppendSlashNotFoundViewFactory(notfound_view)
config.add_view(custom_append_slash, context=HTTPNotFound)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment