[Pythonmac-SIG] Using Python for cgi

Brian Wichmann brian.wichmann at totalise.co.uk
Tue May 1 11:03:20 CEST 2007


Dear all,

I have prototyped a system using MySql and Python which needs to be  
adjusted to use the HTML form data via a web server.  I am on 10.4.

Hence I have put the following:

#!/usr/bin/python

Useful test program (cgitest.py):

#!/usr/bin/python
#cgitest.py

import os, cgi, sys

sys.stderr = sys.stdout

print "Content-type: text/html\r\n"

print cgi.print_environ()

print '<br><br>'
print os.environ

in the directory /Library/WebServer/CGI-Executables/ and made it  
executable.

When I activate it via my HTML form, the result is to display the  
source text of cgitest.py rather than execute it! I hope I have  
followed correctly all the points mentioned in the previous email on  
this list at
http://mail.python.org/pipermail/pythonmac-sig/2002-December/006954.html

Brian Wichmann.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20070501/3603cc2c/attachment.html 


More information about the Pythonmac-SIG mailing list