[Twisted-Python] running a TurboGears from Twisted

David Konerding dakoner at gmail.com
Fri Mar 16 00:58:56 EDT 2007


I want to run a turbogears site from inside Twisted via WSGI.  This isn't
documented, and I'm struggling to get it to work.  This is what I have so

from twisted.web2 import wsgi
from twisted.application import service, strports
from twisted.web2 import server, channel
from twisted.python import util
from turbogears import update_config, start_server
from twisted.web2.wsgi import WSGIResource as WSGI
from cherrypy._cpwsgi import wsgiApp
import cherrypy
cherrypy.lowercase_api = True

# This part gets run when you run this file via: "twistd -noy demo.py"
if __name__ == '__builtin__':

    test = WSGI(wsgiApp)

    # Create the site and application objects
    site = server.Site(test)
    application = service.Application("demo")

    # Serve it via standard HTTP on port 8080
    s = strports.service('tcp:8080', channel.HTTPFactory(site))

I'm not having much luck with this, and I thought I'd check on the list if
anybody already had a recipe for this.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20070315/99992fa9/attachment.htm 

More information about the Twisted-Python mailing list