Again, this is more for my reference than anything else.
Including the following lines on your Python CGI script will save you loads of time and stop you from hating yourself.
import cgitb cgitb.enable()
You can even get the deluxe model by making it write a log file for you
import cgitb cgitb.enable(logdir="location/of/logFile.txt")
It is all explained right here.