Is there anyone who can running web.py as cgi in web hosting provider?
I tried with web.py homepage example (hello world)
python version and .cgi, permission are no problem. I checked.
But I still meet 'Internal Server Error' or blank page.
(blank page is shown when i add
print "Content-Type: text/plain\n\n"
so cgi is no problem)
After code traceing I found 'flup.server.fcgi' so I added flup but
still same error.
I suppose ThreadedServer.run is problem for cgi hosting.
Is there any solution?
I think running in general web hosting is most important factor of web
framework/api.
Can you disable this line from your app code:
web.internalerror = web.debugerror
and see if you still get an error? This requires Cheetah, and in some
scenario, my cgi app didn't work initially 'cos of this.
HTH
deepak
becuase test app code is
urls = (
'/(.*)', 'hello'
)
class hello:
def GET(self, name):
i = web.input(times=1)
if not name: name = 'world'
for c in xrange(int(i.times)): print 'Hello,', name+'!'
if __name__ == "__main__": web.run(urls)
-----------------------------------------------
same as web.py homepage.
no web.internalerror or web.debugerror
thanks.
I'm not sure, but you might try adding this to the top of the file:
#!/usr/bin/env python
woohoo-
Glad to hear it and sorry for your problems. It looks like there was a
bug running as CGI under certain operating systems (like Mac OS X).
Even web.py core file requires python 2.2 or later, flup requires
later. (or not)
my code is running after I added generator enable code (from __future__
import generators) to flup's fcgi.py code.