Re: twisted

Roberto Antonio Ferreira de Almeida <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.devel
Message-ID <[email protected]>
Blake Winton wrote:
> It looks like WSGI is a way to write our app, and have it 
> "automatically" connect to Twisted or mod_python or CGI, or what have 
> you.  If that's really the way it works, it would make our lives (by 
> which I mean Steven's life) a lot easier, since we could just write the 
> app once, and have the connectors deal with the various backends.

Yes, that's exactly it. You would write Pyblosxom as a WSGI
"application" (a class or function), and it would automatically run on
any WSGI server -- Twisted, mod_python, CGI, whatever -- without
modifications.

For example, you would define a class 'PyblosxomWSGI' implementing the
application spec, and to run it as a CGI all that would be necessary is:

   # from http://www.python.org/peps/pep-0333.html
   from cgi_wsgi import run_with_cgi

   from Pyblosxom import PyblosxomWSGI

   run_with_cgi(PyblosxomWSGI(datadir))

Something along these lines. Or you could download the Twisted server
(http://st0rm.hopto.org:8080/wsgi/) and run it like this:

   from twisted_wsgi import serve_application
   serve_application(PyblosxomWSGI(datadir), port=8080)

I would love to help with WSGI, but I'm currently finishing my PhD
thesis and I have no free time.  :(

Roberto



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.