为什么在启动WSGI脚本后我看不到标记“h1”?

2024-04-26 05:12:26 发布

您现在位置:Python中文网/ 问答频道 /正文

我启动UWSGI脚本命令-

uwsgi --socket 0.0.0.0:5000 --protocol=http -w wsgi

在文件夹myapp中

有一个文件(脚本)wsgi.py,内容如下:

def application(environ, start_response):
    start_response('200 OK', [('Content-Type', 'text/html')])
    return ["<h1 style='color:blue'>Hello There!</h1>"]

在我打开我的IP 0.0.0.0:5000之后。没有错误,但没有看到标记(标题)h1

在浏览器中,显示空白页和终端:

[pid: 30736|app: 0|req: 11/11] 176.57.76.232 () {34 vars in 672 bytes} [Sun Apr  7 12:12:22 2019] GET / => generated 0 bytes in 0 msecs (HTTP/1.1 200) 1 headers in 44 bytes (1 switches on core 0)
[pid: 30736|app: 0|req: 12/12] 176.57.76.232 () {36 vars in 645 bytes} [Sun Apr  7 12:12:22 2019] GET /favicon.ico => generated 0 bytes in 0 msecs (HTTP/1.1 200) 1 headers in 44 bytes (1 switches on core 0)

Tags: in脚本appwsgigetbytesresponsevars