CGI Debugging

François Pinard pinard at iro.umontreal.ca
Sun May 28 23:42:43 EDT 2000


"RS Solutions" <richard_chamberlain at ntlworld.com> writes:

> I'm having great difficulties getting Python to work via CGI.  Is there
> anyway I can get the traceback on to the web page so I know what's
> happening?

In other replies, people already told you how to get the traceback generated
into the generated page.  The Python documentation also well documents this.

What happened to me is that sometimes, producing `\n\n<pre>' or such things
are just not sufficient to get you out of some complex HTML structure,
so the browser you use is not able to make enough sense of the partial or
garbled HTML output to display it.

There are two easy solutions.  One is to prefix the output page by
`text/plain' instead of `text/html'.  The other is to leave `text/html',
but use the `View Source' button in your browser to turn your blank page into
the HTML code received: you'll likely find the traceback at the end of it.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard






More information about the Python-list mailing list