Skip to content

Instantly share code, notes, and snippets.

@macalinao
Created December 18, 2011 23:21
Show Gist options
  • Save macalinao/1494796 to your computer and use it in GitHub Desktop.
Save macalinao/1494796 to your computer and use it in GitHub Desktop.
404.py
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