I'm just not cut out for web programming, I guess :)

Paul McNett p at ulmcnett.com
Wed May 17 17:17:39 EDT 2006


John Salerno wrote:
> Ok, I've tinkered with this thing for a while, and I keep fixing little 
> problems, but I always get a 500 Internal Server error when I go to this 
> site:
> 
> I don't necessarily even want help just yet, I'd like to figure it out 
> myself, but can someone at least tell me why I'm not getting helpful 
> feedback from the cgitb module? Am I using it wrong? The webpage just 
> displays the internal server error.
> 
> Thanks.
> 
> 
> 
> import cryptogen
> import cgitb; cgitb.enable()
> 
> quote_file = open('quotes.txt')
> quote = quote_file.readline().strip()
> quote_file.close()
> 
> print '''content-type: text/html
> 
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
>    "http://www.w3.org/TR/html4/strict.dtd">
> 
> <html lang="en-us">
>    <head>
>      <meta http-equiv="content-type" content="text/html; charset=utf-8">
>      <title></title>
>    </head>
> 
>    <body><form action="cryptopage.py">'''
> 
> quote = cryptogen.convert_quote(quote)
> for word in quote[0].split(' '):
>      word_len = len(word)
>      print '<input type="text" name="%s" size="%d">' % (word, word_len)
> 
> print '<input type="submit" value="Submit"></form></body></html>'

Are you sure the python that the web server runs has the cryptogen 
module available? Have you set the execute bit on your script? What's 
the output in your web server error log?

-- 
Paul McNett
http://paulmcnett.com
http://dabodev.com




More information about the Python-list mailing list