Search code examples
pythonpyramid

Change HTTPNotFound renderer using pyramid_handlers


I guess the title speaks for itself.

I've been searching on how to change the page that shows up when a 404 happens on my server. All I've seen so far was chaging it using Hooks as the documentation says.

It turns out I'm using pyramid_handlers and I have no idea how to change it. Would anyone be kind enough to help?


Solution

  • from pyramid.view import notfound_view_config
    
    @notfound_view_config(renderer='404.html')
    def not_found(request):
        return {}