[Tutor] CGI File Woes

wormwood_3 wormwood_3 at yahoo.com
Sun Sep 30 17:38:45 CEST 2007


>>Did you mean for there to be two <html> 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 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 were trying to load.

>>But I usually see this when the web user doesn't have
>>permission to open the html file. But...

This definitely would make the most sense in that the error is not a Python error, at least I am assuming so from the lack of traceback. However, the odd thing is that if I hit template.html directly, the page renders just fine. This would mean the web user can access it, right? And I was assuming the Python script was being run by the web user as well, but perhaps it is not.

>>For all users?
>>Remember that the web server runs as a separate user
>>and that's the user than needs to open the file.

Sorry, I stated that poorly. What I meant was that in the process of troubleshooting, I ended up enabling ALL permissions, so user, group, and others could read, write, and execute. So since this is now the case, and the script runs fine locally, and I can hit template.html on its own on the web server... I am still quite baffled!

-Sam





More information about the Tutor mailing list