猎鹰穿过窗户上的女服务员

2024-09-26 21:52:34 发布

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

我已经开始在Ubuntu上用Falcon做一个API,我也一直在用gunicorn测试它,但我也想在Windows上开发它。在

我们知道gunicorn还不能在Windows上运行,所以我必须使用另一个可以运行wsgi的服务器。经过一番调查,我试着用服务员,但事情并不像我想象的那样。在

问题是,我不知道我做错了什么。在

import srv3
from waitress import serve

serve(srv3, host='127.0.0.1', port=5555) # it is the same if i use serve(srv3)

这是名为srv3的应用程序文件

^{pr2}$

我在运行http localhost:5555时遇到这个错误

HTTP/1.1 500 Internal Server Error
Content-Length: 110
Content-Type: text/plain
Date: Tue, 01 Mar 2016 16:34:45 GMT
Server: waitress

Internal Server Error

The server encountered an unexpected internal server error

(generated by waitress)

有人能给我一个简单的例子,教我如何使用女服务员来测试我的猎鹰应用程序吗?在


Tags: importapi应用程序serverubuntuwindowserrorcontent
1条回答
网友
1楼 · 发布于 2024-09-26 21:52:34

如果你做一个from srv3 import api它似乎可以工作。所以我想应该是这样的:

from srv3 import api
from waitress import serve

serve(api, host='127.0.0.1', port=5555) # it is the same if i use serve(srv3)

相关问题 更多 >

    热门问题