开发者

Problem running webpy Hello World demo

开发者 https://www.devze.com 2023-02-10 19:59 出处:网络
I\'m trying to run the hello world demo from the official web site: import web urls = (\'/.*\', \'index\')

I'm trying to run the hello world demo from the official web site:

import web

urls = ('/.*', 'index')
app = web.application(urls, globals())

class index:  
    def GET(self):   
        return 'Hello,world......'

if __na开发者_Go百科me__ == "__main__":  
    web.wsgi.runwsgi = lambda func, addr = None: web.wsgi.runfcgi(func, addr)  
    app.run()  

When I run it, I get the error:

 File "E:\Text-1.py", line 15, in <module>
    app.run()
  File "D:\tool\EPD\lib\site-packages\web\application.py", line 316, in run
    return wsgi.runwsgi(self.wsgifunc(*middleware))
  File "E:\Text-1.py", line 14, in <lambda>
    web.wsgi.runwsgi = lambda func, addr = None: web.wsgi.runfcgi(func, addr)
  File "D:\tool\EPD\lib\site-packages\web\wsgi.py", line 17, in runfcgi
    return flups.WSGIServer(func, multiplexed=True, bindAddress=addr).run()
  File "D:\tool\EPD\lib\site-packages\flup-1.0.3.dev_20110111-py2.6.egg\flup\server\fcgi.py", line 112, in run
    sock = self._setupSocket()
  File "D:\tool\EPD\lib\site-packages\flup-1.0.3.dev_20110111-py2.6.egg\flup\server\fcgi_base.py", line 1020, in _setupSocket
    'If you want FCGI, please create an external FCGI server '
ValueError: If you want FCGI, please create an external FCGI server by providing a valid bindAddress. If you want CGI, please force CGI operation. Use FCGI_FORCE_CGI=Y environment or forceCGI parameter.

What's the problem?


I don't know if that helps, but I just commented out this line:

web.wsgi.runwsgi = lambda func, addr = None: web.wsgi.runfcgi(func, addr)

It runs ok.

0

精彩评论

暂无评论...
验证码 换一张
取 消