<br><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br>Which version of cherrypy are you using?&nbsp;&nbsp;I did an easy_install<br>cherrypy and got 
3.0.1 but your code didn&#39;t work on it.&nbsp;&nbsp;wsgiApp is<br>somewhere else now or something.</blockquote><div><br><br>OK, I&#39;ve updated my test example to work with CherryPy 3.0.&nbsp; This works a bit better,<br>in fact, when I visit the root of the site I get my cherrypy application!&nbsp; Since
<br>I&#39;m not tied to CherryPy 2.2 (unless TurboGears requires it) this &#39;fixes&#39; most of my problem.<br>I&#39;m still having a problem if I access some URLs under the root, but I have yet to determine if it&#39;s going
<br>to be a problem.<br><br>Here&#39;s a CherryPy 3.0.1 application that works with Twisted web2 using the WSGI app support.<br><br>from twisted.internet import reactor<br>from twisted.application import service, strports
<br>from twisted.web2 import server, channel<br>from twisted.web2 import log<br>from twisted.web2 import wsgi<br>from twisted.web2.wsgi import WSGIResource<br>import cherrypy<br><br>## Basic cherrypy index object that dumps the WSGI environment
<br>class Root(object):<br>&nbsp;&nbsp;&nbsp; @cherrypy.expose<br>&nbsp;&nbsp;&nbsp; def index(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s = []<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for key in cherrypy.request.wsgi_environ:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s.append(&quot;%s=%s&lt;br/&gt;&quot; % (key, cherrypy.request.wsgi_environ
[key]))<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return &quot;&quot;.join(s)<br><br>## Create an instance of the root application and mount it at /<br>r = Root()<br><br>## Convert the Root application to a hostable WSGI application<br>cpwsgiapp = 
cherrypy.Application(Root(), &#39;/&#39;)<br><br>## Convert the CherryPy WSGI app to a Twisted WSGI resource<br>wsgi = wsgi.WSGIResource(cpwsgiapp)<br><br>## Set up the cherrypy environment<br>cherrypy.config.update({<br>
&nbsp;&nbsp;&nbsp; &#39;server.environment&#39;:&#39;production&#39;,<br>&nbsp;&nbsp;&nbsp; })<br><br>## Start the cherrypy engine without starting a blocking server<br>cherrypy.engine.start(blocking=False)<br><br>## Setup default common access logging
<br>res = log.LogWrapperResource(wsgi)<br>log.DefaultCommonAccessLoggingObserver().start()<br><br># Create twisted web2 site<br>site = server.Site(res)<br><br>## Launch the HTTP site at port 8080<br><br>## code path invoked by twistd
<br>if __name__ == &#39;__builtin__&#39;:<br>&nbsp;&nbsp;&nbsp; application = service.Application(&quot;demo&quot;)<br>&nbsp;&nbsp;&nbsp; s = strports.service(&#39;tcp:8080&#39;, channel.HTTPFactory(site))<br>&nbsp;&nbsp;&nbsp; s.setServiceParent(application)<br><br>
## code path when run directly<br>if __name__ == &#39;__main__&#39;:<br>&nbsp;&nbsp;&nbsp; from twisted.python import log as pythonlog<br>&nbsp;&nbsp;&nbsp; import sys<br>&nbsp;&nbsp;&nbsp; pythonlog.startLogging(sys.stdout)<br>&nbsp;&nbsp;&nbsp; reactor.listenTCP(8080, channel.HTTPFactory
(site))<br>&nbsp;&nbsp;&nbsp; reactor.run()<br><br></div><br></div><br>