2016-03-01 74 views
2

我已經開始在Ubuntu上使用Falcon製作API,我一直在使用gunicorn來測試它,但我也想嘗試在Windows上開發它。Falcon通過在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) 

時,可能會有人告訴我如何使用女服務員來測試一個簡單的例子,我得到這個錯誤我的獵鷹應用程序?

+0

謝謝你把它放在窗口的工作 – mtyson

回答

2

如果你做了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) 
+0

是啊,我正式白癡,這個工作,它是相當明顯的,因爲我沒有通過應用女服務員,我正在通過該文件。 – Nick

相關問題