[Pythonmac-SIG] MacPython, CGI and free cd's
Jack Jansen
jack@oratrix.nl
Thu, 03 Aug 2000 12:30:30 +0200
> At 11:05 AM +0200 03-08-2000, Jack Jansen wrote:
> >But you don't do stdout-to-appleevent reply mapping yet, or do you?
>
> Of course I do: it wouldn't be compatible otherwise... Really, unix CGI
> scripts do work as-is under a Mac web server, as long as they don't do
> unixy things like forking, executing shell commands or opening pipes.
Ah, wow! It's a lot more complete than I had expected, then!
> Apart from the server configuration (which I think is not harder than
> setting up a Python CGI script under Unix), it is dead simple. But you're
> right, something that works right away is better.
Will something simple like dropping the applet in the server's CGI directory
work? If we can explain this is a few simple sentences for Personal Websharing
I think we're all set. Personal Websharing is what everyone will start with
nowadays, as it's included in MacOS, so I guess we can safely assume that
anyone who has a more powerful server will also have the knowledge about where
to put CGI stuff for their brand of server.
> Web servers generally don't offer any help in debugging CGI scripts, they
> just barf "Internal server error" at you when something goes wrong. That's
> virtually the same on any platform. Catching exceptions and sending it to
> the browser is in my optinion the job of the CGI script itself, and not
> correct behavior for any web server or Python wrapper. And it's easy enough
> to do:
>
> import cgi, traceback
>
> print "Content-type: text/html"
> print
>
> try:
> domycgistuff()
> except:
> cgi.print_exception()
But why wouldn't we do something nicer for Python users? Putting the
try/except in the wrapper, for instance (the user can always override it with
another try/exceept in their script).
Also, on unix you can test your CGI script with something like
% QUERY_STRING=arg+arg+arg cgi-bin/myscript
but on the mac this isn't possible, but we could easily provide some help.
Hmm, maybe this should be folded into the IDE? If you could "Run as CGI" from
the IDE and then "Save as CGI" (which would save in the right place, copy the
applet, etc) we would be giving people a pretty decent CGI development
environment...
--
Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm