Python-fastcgi extension


There's not much documentation surrounding the python-fastcgi C library, so I'm wondering if someone could provide a simple example on how to make a simple FastCGI server with it. A "Hello World" example would be great.

Best Solution

Edit: I misread the question. Ooops.

Jon's Python modules is a collection of useful modules and includes a great FastCGI module:

Here's the example from the page:

import jon.cgi as cgi 
import jon.fcgi as fcgi

class Handler(cgi.Handler):
  def process(self, req):
    req.set_header("Content-Type", "text/plain")
    req.write("Hello, world!\n")

fcgi.Server({fcgi.FCGI_RESPONDER: Handler}).run()