12 messages in com.googlegroups.pylons-discussRe: Configuring PYTHONPATH with fcgi| From | Sent On | Attachments |
|---|---|---|
| Matthew Burgess | 13 Aug 2006 13:16 | |
| Mathias GUG | 13 Aug 2006 13:49 | |
| Jamie Wilkinson | 13 Aug 2006 15:11 | |
| Matthew Burgess | 13 Aug 2006 15:48 | |
| Mathias GUG | 13 Aug 2006 17:24 | |
| Matthew Burgess | 14 Aug 2006 10:17 | |
| Matthew Burgess | 14 Aug 2006 10:34 | |
| Mathias GUG | 14 Aug 2006 14:34 | |
| Mathias GUG | 14 Aug 2006 14:42 | |
| Philip Jenvey | 14 Aug 2006 15:59 | |
| uuellbee | 17 Aug 2006 07:59 | |
| Matthew Burgess | 08 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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to pylo...@googlegroups.com
To unsubscribe from this group, send email to
pylo...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/pylons-discuss
-~----------~----~----~----~------~----~------~--~---




