terom@67: #!/usr/bin/python2.5 terom@67: terom@67: """ terom@67: WSGI FastCGI support using flup (grr, threads). terom@67: terom@67: Currently, this uses flup.server.fcgi, but it attempts to batten down the hatches against the evil that is terom@67: *threads* :) terom@67: """ terom@67: terom@67: import flup.server.fcgi terom@67: terom@67: def run (app, bind=None) : terom@67: """ terom@67: Run as a non-threaded single-process non-multiplexed FastCGI server terom@67: """ terom@67: terom@67: # create WSGIServer terom@67: server = flup.server.fcgi.WSGIServer(app, terom@67: # try to supress threading terom@67: multithreaded=False, terom@67: multiprocess=False, terom@67: multiplexed=False, terom@67: terom@67: # specify the bind() address terom@67: bindAddress=bind, terom@67: terom@67: # leave as defaults for now terom@67: umask=None, terom@67: terom@67: # XXX: non-debug mode? terom@67: debug=True, terom@67: ) terom@67: terom@67: # run... threads :( terom@67: server.run() terom@67: