Waitress WSGI Server

3.0.2 · active · verified Thu Apr 09

Waitress is a production-quality pure-Python WSGI server with a focus on simplicity and reliability. It's actively maintained by the Pylons Project, receiving frequent updates to support new Python versions and address security concerns. The current version is 3.0.2.

Warnings

Install

Imports

Quickstart

This example demonstrates how to serve a minimal WSGI application using Waitress. It defines a simple WSGI callable `simple_app` and then uses `waitress.serve()` to run it on `127.0.0.1:8080`.

from waitress import serve

def simple_app(environ, start_response):
    """A barebones WSGI application."""
    status = '200 OK'
    headers = [('Content-type', 'text/plain; charset=utf-8')]
    start_response(status, headers)
    return [b"Hello from Waitress!"]

if __name__ == '__main__':
    print("Serving on http://127.0.0.1:8080")
    serve(simple_app, host='127.0.0.1', port=8080)

view raw JSON →