[Zope] CGI product ( was ZServer serving CGI by itself )
Eric Walstad
Eric@Walstads.net
Sun, 05 Nov 2000 16:36:18 -0800
Hi Fred,
Wow, you've left me in the dust. I've not needed to try what you are
attempting and I don't know how Zope would handle passing the RESPONSE buck
to another application. I hope someone with more "Zen" can answer the
particulars for you!
Best of luck.
Eric.
// However, I have a couple of added complexities.
//
// First, I have a lot of scripts, not just one. I'd like to have the
// equivalent of a ScriptAlias in Apache, where I can tell Zope to treat
// everything in a certain directory as a CGI script.
//
// Second, my scripts do funky things like set cookies for authentication.
// So I need to tell Zope to basically get out of the way after calling the
// CGI script. (Specifically, I don't want Zope sending the HTTP header.)
//
// Third, some of my scripts are long running processes and I'd like to be
// able to send results back to the client unbuffered. With Apache 1.3.x,
// I'm able to run Python scripts with the -u flag to the Python
// interpreter to force unbuffered output (i.e. you see the progress
// instead of having to wait for the script to finish).
//
// I'm thinking of writing a CGIScript product to handle this. My idea is
// that I could add a CGIScript object to any Zope folder, setting
// parameters as appropriate. Parameters could include:
//
// 1) name of CGI script to execute on host machine or name of directory
// containing CGI scripts
// 2) buffer output
// 3) script sends HTTP headers
// 4) environment variables
// 5) exception handling
//
// Has a general CGI product in Zope already been done? I've already
// written a few external methods in testing Zope, which is easy enough,
// but haven't yet tried to write a product. How hard is it? Anyone have
// any advice (aside from go with the flow and run Zope behind Apache)?
//
// Thanks,
// Fred
//
// P.S. Is standard_error_message broken in Zope 2.2.2? I couldn't figure
// out how to use error_value without the code in
// lib/python/ZPublisher/HTTPResponse.py throwing in extra <html> tags. I
// finally just edited that file and things seem to be working. Running
// with or without the -D flag didn't make any difference.