wsgi application integration for TG 11 app serving under cherrypy 2

View: New views
3 Messages — Rating Filter:   Alert me  

wsgi application integration for TG 11 app serving under cherrypy 2

by Diez B. Roggisch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

I'm in need of integration for an existing WSGI-app into an existing
TurboGears 1.1 application to develop.

Because TG1.1 ships with cherrypy2.x, this can't be done with the latest and
greatest of CP :(

I know how I can deploy cherrypy 2 as WSGI-app itself, and could work around
by creating a WSGI-app that at some point (path) serves my TG app.

However for incremental migration of the existing app to TG, I'd like to do it
the other way round. So the idea is to do something like this:

class MyApp(Controller):
   @expose
   def method(self, ...):
        ...

   old_part = WSGIAdapter(old_part_entry_function)

where MyApp is the TG-controller of course.

Any suggestions on the feasibility and implementation for this? I'm pretty
sure I can mimic the WSGI-environ - the biggest issue is the
start_response-stuff & dealing with headers and the like.

Any suggestions highly appreciated.
--
Diez B. Roggisch

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users@...
To unsubscribe from this group, send email to cherrypy-users-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: wsgi application integration for TG 11 app serving under cherrypy 2

by Robert Brewer-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Diez B. Roggisch wrote:

> I'm in need of integration for an existing WSGI-app into
> an existing TurboGears 1.1 application to develop.
>
> Because TG1.1 ships with cherrypy2.x, this can't be done
> with the latest and greatest of CP :(
>
> I know how I can deploy cherrypy 2 as WSGI-app itself,
> and could work around by creating a WSGI-app that at some
> point (path) serves my TG app.
>
> However for incremental migration of the existing app to TG,
> I'd like to do it the other way round. So the idea is to do
> something like this:
>
> class MyApp(Controller):
>    @expose
>    def method(self, ...):
>         ...
>
>    old_part = WSGIAdapter(old_part_entry_function)
>
> where MyApp is the TG-controller of course.
>
> Any suggestions on the feasibility and implementation for this?
> I'm pretty sure I can mimic the WSGI-environ - the biggest issue
> is the start_response-stuff & dealing with headers and the like.

Oh, the trail of woe and tears you are embarking upon. ;) The far bigger issue is that, once you leave WSGI and enter code which buffers the response, you can't safely go back to WSGI. See http://www.cherrypy.org/ticket/700. From there, you can probably glean that CP 2 has a wsgiappfilter, which you could use if you need a quick fix, but you didn't hear that from me since it's deprecated.


Robert Brewer
fumanchu@...


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users@...
To unsubscribe from this group, send email to cherrypy-users-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: wsgi application integration for TG 11 app serving under cherrypy 2

by Diez B. Roggisch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


> > Any suggestions on the feasibility and implementation for this?
> > I'm pretty sure I can mimic the WSGI-environ - the biggest issue
> > is the start_response-stuff & dealing with headers and the like.
>
> Oh, the trail of woe and tears you are embarking upon. ;)

I feared so...

> The far bigger
> issue is that, once you leave WSGI and enter code which buffers the
> response, you can't safely go back to WSGI. See
> http://www.cherrypy.org/ticket/700. From there, you can probably glean that
> CP 2 has a wsgiappfilter, which you could use if you need a quick fix, but
> you didn't hear that from me since it's deprecated.


Will dig into that. And I don't mind the deprecation... only the brave win the
hearts of the beautiful maidens from the garden of integration. Or so. :)

Diez

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users@...
To unsubscribe from this group, send email to cherrypy-users-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---