cgi scripts in Mac OS X

Jeff McNeil jeff at
Sat Oct 20 19:24:45 CEST 2007

Your web server needs to be told to execute Python scripts.  You can
handle it a few different ways, depending on your environment.

1. Place your .py script inside of a ScriptAlias'd /cgi-bin/ directory
which will force it to be executed.

2. Rename your .py script to .cgi and add an 'AddHandler cgi-script
.cgi' to your Apache configuration

3. Add an AddHandler cgi-script .py to your Apache configuration.

This of course assumes that Apache is configured in a way that would
allow execution and whatnot.  Do yourself a favor and give
'' a read over as it's
going to cover a lot more than I just did.


On 10/20/07, Brian Shine <brianshine at> wrote:
> I'm trying to get cgi scripts to work.  I can link to the python
> script, but instead of running and producing an output, it prints the
> script on the page.  I've obviously missed a step in setting it up,
> but I can't see what it is.
> Thanks in advance,
> Brian Shine
> --

More information about the Python-list mailing list