> Did you stack paste.httpexceptions' middleware?
>
> There should be a line inside your project's middleware.py's make_app()
> like this one:
>
> http://trac.turbogears.org/browser/trunk/tg/templates/turbogears/%2Bpackage%2B/config/middleware.py_tmpl#L66
Got it, Alberto it looks like you put the stack in the wrong place in
middleware.py template. I just moved the new stuff up to right spot and
now redirect is working. Yay!
What am I supposed to use to patch for things kind of things anyway?
I've never patched someone else's python code in svn before so I'm
reluctant to screw it up.
Anyway. Change this:
# Configure and add ToscaWidgets support
host_framework = PylonsHostFramework(default_view="genshi")
app = TGWidgetsMiddleware(app, host_framework)
# CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares)
if asbool(full_stack):
# Handle Python exceptions
app = ErrorHandler(app, global_conf,
error_template=error_template,
**config['pylons.errorware'])
# Display error documents for 401, 403, 404 status codes (and
# 500 when debug is disabled)
app = ErrorDocuments(app, global_conf, mapper=error_mapper,
**app_conf)
# Stack httpexceptions middleware so redirect, abort, etc.. work
# XXX: Why doesn't Pylons stack this internally?
app = httpexceptions.make_middleware(app)
To this:
# Configure and add ToscaWidgets support
host_framework = PylonsHostFramework(default_view="genshi")
app = TGWidgetsMiddleware(app, host_framework)
# CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares)
# Stack httpexceptions middleware so redirect, abort, etc.. work
# XXX: Why doesn't Pylons stack this internally?
app = httpexceptions.make_middleware(app)
if asbool(full_stack):
# Handle Python exceptions
app = ErrorHandler(app, global_conf,
error_template=error_template,
**config['pylons.errorware'])
# Display error documents for 401, 403, 404 status codes (and
# 500 when debug is disabled)
app = ErrorDocuments(app, global_conf, mapper=error_mapper,
**app_conf)
# Establish the Registry for this application
app = RegistryManager(app)
And it works.
Iain
>
> Alberto
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---