Add the following code to the top of a CGI Python script to enable colorized, annotated traceback formatting whenever a fatal error occurs in your script:
import cgitb; cgitb.enable()
When in development mode, this is likely more helpful than a '500 Internal Server Error'.
cgicolorerrorsfatalimportlanguagesmodulesprogrammingpythonscripttraceback