[Moin-user] http_redirect from within a macro?

Paul Boddie paul at boddie.org.uk
Mon Aug 15 16:38:04 EDT 2011

On Monday 15 August 2011 20:52:42 Neal Holtz wrote:
> Is it possible to request an http redirect from within a macro
> handler?  Using moinmoin 1.9.3, when I try:
> def macro_Quiz( macro, filename ):
> ....
>           macro.request.http_redirect( 'http://www.disney.com', code=301 )
> <<Quiz: execution failed [proxy exception for
> <werkzeug.wrappers.BaseResponse object at 0xaacbb4c>] (see also the log)>>

What does the log say? I looked at some actions and you'd use the 
http_redirect method on the request in that environment, but I don't know if 
that works for macros, mostly because macros are executed during output 
production, at which point it's probably a bit late to attempt a redirect: 
the HTTP status code will have been set and page content partially written.


More information about the Moin-user mailing list