By applying Takashi's patch to Werkzeug 0.6 tip (930:d168af1b0904),
and wrapping the WSGI app with a CGIHandler like so (from Kay), the
debugger performs perfectly as designed:
from wsgiref.handlers import CGIHandler
class MyHandler(CGIHandler):
"""
wsgiref.handlers.CGIHandler holds os.environ when imported.
This class override this behaviour.
"""
def __init__(self):
self.os_environ = {}
CGIHandler.__init__(self)
def main():
MyHandler().run(wsgi_app)
CGIHandler seems to set a sys.stdout while 'from
google.appengine.ext.webapp.util import run_wsgi_app' does not.
Thank you Takashi for figuring this out, and for all your help.
Robin
On Sep 29, 8:46 pm, Takashi Matsuo <[email protected]> wrote:
> On Wed, Sep 30, 2009 at 10:38 AM, Robin B <[email protected]> wrote:
>
> > Takashi,
>
> > I applied the patch cleanly to the Werkzeug (0.6) tip. Now no
> > Exception is thrown, but the result of the console expression does not
> > show up on the page.
>
> > Any ideas?
>
> Storing DebuggedApplication instance as a module global variable for
> caching might work for you.
>
> For details, please see
> here:http://takashi-matsuo.blogspot.com/2009/05/using-werkzeugs-debugger-o...
>
> or here:http://code.google.com/p/kay-framework/source/browse/kay/main.py
>
> Regards,
>
> --
> Takashi Matsuo
> The father of kay framework
>
>
>
> > Thanks,
>
> > Robin
>
> > On Sep 29, 5:26 pm, Takashi Matsuo <[email protected]> wrote:
> >> Hi Armin,
>
> >> I wrote a patch for werkzeug months ago. Its
> >> here:http://dev.pocoo.org/projects/werkzeug/ticket/385
>
> >> Could you look at that patch if you like.
>
> >> Robin,
> >> Perhaps you can use my patch. I encountered the same issue as yours a
> >> long time ago :)
>
> >> My blog article about
> >> it:http://takashi-matsuo.blogspot.com/2009/05/using-werkzeugs-debugger-o......
>
> >> I usually maintain my own web framework which is a kind of
> >> distribution including lots of pocoo stuff for gae. It is hosted
> >> here:http://code.google.com/p/kay-framework/
>
> >> Regards,
>
> >> --
> >> Takashi Matsuo
> >> The father of kay framework
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pocoo-libs" 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/pocoo-libs?hl=en
-~----------~----~----~----~------~----~------~--~---