durusmail: quixote-users: An SCGI client module for Twisted Web
An SCGI client module for Twisted Web
2004-07-31
2004-07-31
2004-07-31
2004-07-31
An SCGI client module for Twisted Web
Matt Campbell
2004-07-31
Hello,

I like Dulcinea's site management system, but I want to use Twisted Web
instead of Apache.  The main advantage of Twisted Web in this case is
that it's a pure-Python web server that can be installed using distutils
on any machine where Python runs.  Apache installations, on the other
hand, vary significantly in both version and file system layout.  So if
Twisted Web was used, then the dist.py script that comes with Toboso
would work -- and even be able to start the site automatically -- on any
Unix machine running Python.  And while this has yet to be proven, I
think the combination of Twisted Web and Quixote using SCGI would yield
good performance.

So I wrote a module called twscgi.py which is like twisted/web/twcgi.py
from the Twisted distribution but is an SCGI client.  Though it doesn't
matter to me where this module goes, I've placed it in my copy of the
scgi package.  I also wrote a little test program which instantiates and
starts a Twisted Web server that passes all requests to the SCGI server
on port 1984 (the one used by Toboso).  As far as I can tell it works
fine.  Of course, Twisted Web could also be configured to pass requests
for some paths to the SCGI server and handle the rest itself, as with
Apache.  I still need to modify the site management scripts to use
Twisted Web instead of Apache.

What's the best way for me to share this code?  I thought about
attaching the two .py files, but I'm not sure if file attachments are
acceptable on this list.

--
Matt Campbell
Lead Programmer
Serotek Corporation
www.freedombox.info


reply