解决方法
WSGI实际上并不是FastCGI上的一个层,而是一个编写Python Web应用程序的规范,它足够通用,可以附加到许多Web服务器或适配器上,而这些Web服务器或适配器可能会涉及许多其他技术,包括FastCGI.但是,FastCGI本身,即Web服务器连接到长时间运行的进程的协议,在WSGI安装中根本不需要涉及 – 例如. mod_wsgi Apache模块,它直接从Apache向您的Python应用程序公开WSGI,并且不需要您运行单独的长时间运行的进程.
WSGI在PEP 333中定义.从该规范中获取的简单应用程序如下所示:
def simple_app(environ,start_response): """Simplest possible application object""" status = '200 OK' response_headers = [('Content-type','text/plain')] start_response(status,response_headers) return ['Hello world!\n']