uwsgi 发布了 Python 3.4 应用程序,env['wsgi.errors'] = <_io.TextIOWrapper name=2 mode='w' encoding='ANSI_X3.4-1968'>

uwsgi published Python 3.4 app, env['wsgi.errors'] = <_io.TextIOWrapper name=2 mode='w' encoding='ANSI_X3.4-1968'>

我正在学习 webdev 的基础知识。我开始使用 uwsgi 发布 python3.4 应用程序。 它工作正常(使用 Jinja2 模板引擎输出 env 字典),但我找不到 header 的意思:

env['wsgi.errors'] = <_io.TextIOWrapper name=2 mode='w' encoding='ANSI_X3.4-1968'>

我是否需要修复某些东西或它就像 object link?

编辑:

更具体地说,这是我正在谈论的代码示例:

def application(env, start_response):
    start_response('200 OK', [('Content-Type','text/html')])
    return [b"Hello World"]

如描述的那样here

编辑2:

Link to that app 输出 headers

这不是错误,它是一个对象,您可以在其中将错误写入 uwsgi 服务器日志。

例如:

def application(env, start_response):
    print('Hello, Lepra!', file=env['wsgi.errors'])
    start_response('200 OK', [('Content-Type','text/html')])
    return [b"Hello World"]

链接: