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?
Falcon is a blazing fast, minimalist Python web API framework for building robust app backends and microservices. The framework works great with both asyncio (ASGI) and gevent/meinheld (WSGI).
Falcon is a reliable, high-performance Python web framework for building large-scale app backends and microservices. It encourages the REST architectural style, and tries to do as little as possible while remaining highly effective.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With