【问题标题】:Falcon through Waitress on Windows OS猎鹰通过 Windows 操作系统上的女服务员
【发布时间】:2016-06-14 04:15:18
【问题描述】:

我已经开始在 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 的应用文件

import falcon

api = application = falcon.API()

运行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)

谁能给我看一个关于如何使用女服务员测试我的猎鹰应用程序的快速示例?

【问题讨论】:

  • 感谢它在 Windows 上运行

标签: python wsgi waitress falcon


【解决方案1】:

如果您执行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)

【讨论】:

  • 是的,我确实是个白痴,这很有效,而且很明显,因为我没有将应用程序传递给女服务员,而是传递了文件。
猜你喜欢
  • 2019-01-04
  • 2017-03-17
  • 1970-01-01
  • 2016-02-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-06-08
相关资源
最近更新 更多