12 messages in com.googlegroups.pylons-discussRe: Configuring PYTHONPATH with fcgi
FromSent OnAttachments
Matthew Burgess13 Aug 2006 13:16 
Mathias GUG13 Aug 2006 13:49 
Jamie Wilkinson13 Aug 2006 15:11 
Matthew Burgess13 Aug 2006 15:48 
Mathias GUG13 Aug 2006 17:24 
Matthew Burgess14 Aug 2006 10:17 
Matthew Burgess14 Aug 2006 10:34 
Mathias GUG14 Aug 2006 14:34 
Mathias GUG14 Aug 2006 14:42 
Philip Jenvey14 Aug 2006 15:59 
uuellbee17 Aug 2006 07:59 
Matthew Burgess08 Sep 2006 13:21 
Subject:Re: Configuring PYTHONPATH with fcgi
From:Mathias GUG (math@gmail.com)
Date:08/14/2006 02:42:21 PM
List:com.googlegroups.pylons-discuss

Hi,

On 8/14/06, Matthew Burgess <matt@linuxfromscratch.org> wrote:

Thanks for those, I was also having problems with the rewrite URLS on the wiki page. The above sorted it nicely!

Regards,

Also, I had to modify the error mapper in middleware.py, otherwise flup was raising loop errors when an HTTP error was raised. It seems that the "Fixing Broken Routes" code doesn't apply to errors.

So I've defined my own error mapper in config/middleware.py (based on the original error_mapper function from pylons - it just removes '/dispatch.fcgi' from the url) :

def my_error_mapper(code, message, environ, global_conf=None, **kw): if global_conf is None: global_conf = {} codes = [401, 403, 404] if not asbool(global_conf.get('debug')): codes.append(500) if code in codes: url = '%s/error/document/?%s'%(get_prefix(environ), urlencode({'message' :message, 'code':code})) if url.startswith('/dispatch.fcgi'): url = url[14:] return url

And replace the ErrorDocuments line in make_app :

app = ErrorDocuments(app, global_conf, mapper=my_error_mapper, **app_conf)

After that, error documents are working.

Mathias