[Twisted-Python] FYI: sample of interpreted CGI usage in twisted (1.0.6, for windows)

gian paolo ciceri gp.ciceri at acm.org
Sun Jul 6 14:12:16 MDT 2003


Hello all,
yesterday I've discussed with Itamar in chat
about this setup. He suggested to me to send the
example to the mailing list, for future reference.
It seems that the interesting thing is that it
works on windows, with an interpreted script as cgi.

I use it for moinmoin under twisted.

You've to use the win32 reactor, of course.

Thanks for your attention, have a nice day.

Regards.
/gp

##############################################################
import os
from twisted.internet import app
from twisted.web import static, server, vhost, twcgi, script, trp


root = static.File(os.getcwd() + "/public_html")

class PythonCGIScript(twcgi.FilteredScript):
     filter = 'c:\\Python22\\python.exe' # Points to the python parser

root.processors = {
             '.pcgi': PythonCGIScript,
             '.epy': script.PythonScript,
             '.rpy': script.ResourceScript,
             '.trp': trp.ResourceUnpickler,
}
root.putChild('vhost', vhost.VHostMonsterResource())
site = server.Site(root)
application = app.Application('web')
application.listenTCP(10999, site)
#####################################################################






More information about the Twisted-Python mailing list