Re: Correct way to use a custom 404 view

2011-09-14 Thread Benjamin Sims
Thanks Michael, adding a view for the Exception context worked perfectly. So, I did this in __init__.py: from myapp.system import error_view config.add_view(error_view, renderer = 'templates/error_template.pt', context=Exception) Ben On 13 September 2011 23:41, Michael Merickel wrote: > The wa

Re: Correct way to use a custom 404 view

2011-09-13 Thread Michael Merickel
The way to think about this is that Pyramid is at the end of a WSGI pipeline. It supports a way for catching and handling any exceptions that occur within Pyramid itself via exception views. You have seen one exception view already via the HTTPNotFound exception. You may add an exception view for a

Re: Correct way to use a custom 404 view

2011-09-13 Thread Benjamin Sims
Thanks Chris, that works great. Sorry for the follow on question, but is there a similar way to handle Python errors/500? I have set up pyramid_exclog to send any errors to me by email. I also have the following lines in my ini: [pipeline:main] pipeline = tm myapp [filter:weberror] use

Re: Correct way to use a custom 404 view

2011-09-13 Thread Chris McDonough
On Tue, 2011-09-13 at 15:05 +0100, Benjamin Sims wrote: > Hi, > > I'm trying to generate a custom 404 view for my application. I've > read: > > https://pylonsproject.org/projects/pyramid/dev/narr/hooks.html#changing-the-notfound-view > > However, I want to be able to have the 404 use a Chameleon

Correct way to use a custom 404 view

2011-09-13 Thread Benjamin Sims
Hi, I'm trying to generate a custom 404 view for my application. I've read: https://pylonsproject.org/projects/pyramid/dev/narr/hooks.html#changing-the-notfound-view However, I want to be able to have the 404 use a Chameleon template with macros and so forth in order to fit in with the overall l