Of course it would also be possible to do 1 and 2 inside of the use_wsgi_app function, and I thought I added a ticket to make that happen, but I can't find it now.
One use case of use_wsgi_app was that's not covered by the above example is that we wanted it to be simple to just return the response OR for the controller to monkey with the response on the way out. But, I like the idea of a mounting a wsgi application more directly than use_wsgi_app allows... On Fri, Jan 9, 2009 at 3:38 PM, Alberto Valverde <[email protected]> wrote: > > The current solution (ie: use_wsgi_app) does not quite cut it. The > problem is that to effectively mount a WSGI app inside a TG app two > things must be done beofre delegating the request: > > 1) Pop a number of path elements from PATH_INFO into SCRIPT_NAME. This > is needed so the inner app knows where it's mounted at and can generate > urls, etc.. > 2) Copy the environ before doing 1. This is because if the inner app > returns an error status code that TG's middleware is configured to trap, > the static links in the error page TG/Pylons generates won't be built > properly since the SCRIPT_NAME is the one that has been updated for the > inner app. > > So, I propose a solution like this one: > http://hg.python-rum.org/TgRum/file/73c6d8a87fb2/tgrum.py#l12 > > Sounds good? Can I move that code, with a better name (ideas please, > else I'll leave it as RumController.. ;), to somewhere inside TG2? > Where? Where in the docs can I mention it? > > Alberto > > > > -- Mark Ramm-Christensen email: mark at compoundthinking dot com blog: www.compoundthinking.com/blog --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
