Re: [Tutor] CGI File Woes

2007-09-30 Thread Martin Walsh
Martin Walsh <[EMAIL PROTECTED]> > To: tutor@python.org > Sent: Sunday, September 30, 2007 1:07:02 PM > Subject: Re: [Tutor] CGI File Woes > > No doubt cgitb is a great tool for debugging cgi, but IIUC there are at > least two instances when you will not get the pretty p

Re: [Tutor] CGI File Woes

2007-09-30 Thread wormwood_3
and Martin. -Sam _ - Original Message From: Martin Walsh <[EMAIL PROTECTED]> To: tutor@python.org Sent: Sunday, September 30, 2007 1:07:02 PM Subject: Re: [Tutor] CGI File Woes No doubt cgitb is a great tool for debugging cgi, but IIUC there are at least two instanc

Re: [Tutor] CGI File Woes

2007-09-30 Thread Martin Walsh
wormwood_3 wrote: >>> I've never used cgitb (and until now didn't know it existed!) >>> so can't comment. > > I had not heard of it until this week when I started working on CGI stuff, > but I have found it super handy! All you have to do it "import cgitb; > cgitb.enable()" and all tracebacks wi

Re: [Tutor] CGI File Woes

2007-09-30 Thread Noufal Ibrahim
wormwood_3 wrote: > Hello all, > I am working on a very simple CGI script. The site I want to use it > on is a shared linux host, but I confirmed that .py files in the > right dir with the right permissions and shebang execute just fine, > Hello World sort of tests were successful. Those are the f

Re: [Tutor] CGI File Woes

2007-09-30 Thread Alan Gauld
"wormwood_3" <[EMAIL PROTECTED]> wrote > I had not heard of it until this week when I started working on > CGI stuff, but I have found it super handy! All you have to do > it "import cgitb; cgitb.enable()" and all tracebacks will get > printed to nicely formatted HTML output on the page you

Re: [Tutor] CGI File Woes

2007-09-30 Thread wormwood_3
>>Did you mean for there to be two tags or is it a typo? Just a typo. Should not have a big effect, but it has been fixed. >>I've never used cgitb (and until now didn't know it existed!) >>so can't comment. I had not heard of it until this week when I started working on CGI stuff, but I have f

Re: [Tutor] CGI File Woes

2007-09-30 Thread Michael Langford
Remember, you can always add more logging that goes to your own log file. Have it open a file in /tmp and write out a log of what's happening. Wrap your main code block in an exception handler, etc. Have it print out the exception to the log file. This will allow you to look and see what the erro

Re: [Tutor] CGI File Woes

2007-09-30 Thread Alan Gauld
"wormwood_3" <[EMAIL PROTECTED]> wrote > #!/usr/bin/python2.4 > > import cgitb; cgitb.enable() > > thefile = open("template.html", "r") > templatestuff = thefile.read() > thefile.close() > print "Content-Type: text/html" > if templatestuff: >print "Found it" > title1 = "I am a title!" > body1

Re: [Tutor] CGI File Woes

2007-09-29 Thread Eric Walker
The best way to debug cgi is to tail the server log when you don't get commandline output. This will give you a clue to what is happening.. shoulld be something like /var/log/apache or something like that... Eric wormwood_3 <[EMAIL PROTECTED]> wrote: Hello all, I am working on a very sim