请创建一个显示此错误的最小(“hello world”)函数,以便我们可以对您的代码进行注释。[不要发布您的整个申请,它可能太大,我们无法评论。]
os.environ不是您应该使用的。WSGI用一个丰富的环境取代了这一点。WSGI应用程序有两个参数:一个是包含'wsgi.input'的字典。在
在你的代码里。。。在def application(environ, start_response):
try:
f = cgi.FieldStorage(fp=os.environ['wsgi.input'], environ=os.environ)The environ parameter is a dictionary
object, containing CGI-style
environment variables. This object
must be a builtin Python dictionary
(not a subclass, UserDict or other
dictionary emulation), and the
application is allowed to modify the
dictionary in any way it desires. The
dictionary must also include certain
WSGI-required variables (described in
a later section), and may also include
server-specific extension variables,
named according to a convention that
will be described below.