0

我正在尝试一个简单的 WSGI 网络服务,例如:

from flup.server.fcgi import WSGIServer
import sys, os

def app(environ, start_response):
    start_response('200 OK', [('Content-Type', 'text/html')])

    yield '<h1>FastCGI Environment</h1>'
    yield '<table>'
    for k, v in sorted(environ.items()):
         yield '<tr><th>{0}</th><td>{1}</td></tr>'.format(
         escape(k), escape(v))
    yield '</table>'


if __name__ == '__main__':
    WSGIServer(app).run()

我收到此错误: Traceback (most recent call last): File "test.py", line 19, in <module> WSGIServer(app).run() File "C:\Anaconda2\lib\site-packages\flup\server\fcgi.py", line 112, in run sock = self._setupSocket() File "C:\Anaconda2\lib\site-packages\flup\server\fcgi_base.py", line 978, in _setupSocket sock = socket.fromfd(FCGI_LISTENSOCK_FILENO, socket.AF_INET, AttributeError: 'module' object has no attribute 'fromfd'

这是什么意思?

4

0 回答 0