Search code examples
pythonwsgiwaitressfalcon

Falcon through Waitress on Windows OS


i've started making an API using Falcon on Ubuntu and I've been using gunicorn to test it but I also want to try developing it on Windows too.

As we know gunicorn doesn't work on Windows yet so I will have to use another server that can run wsgi. After some research I tried using waitress but things don't work the way I thought it would.

Thing is, i don't know what I am doing wrong.

import srv3
from waitress import serve

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

This is the app file called srv3

import falcon

api = application = falcon.API()

and i get this error when running 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)

could someone show me a quick example on how to use waitress to test out my falcon app?


Solution

  • If you do a from srv3 import api it seems to work. So I think it should be something like this:

    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)