Paste (WSGI Toolkit)

3.10.1 · active · verified Sun Apr 12

Paste is a comprehensive set of tools for developing, deploying, and managing Web Server Gateway Interface (WSGI) applications. It includes components for serving WSGI applications, handling exceptions, parsing URLs, and more. The current version is 3.10.1, with a release cadence that has slowed down over recent years, focusing on Python 3 compatibility and maintenance.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to define a basic WSGI application and serve it using Paste's built-in HTTP server. Run this script and visit http://127.0.0.1:8000 in your browser.

from paste.httpserver import serve

def simple_app(environ, start_response):
    status = '200 OK'
    headers = [('Content-type', 'text/plain; charset=utf-8')]
    start_response(status, headers)
    return [b'Hello, Paste!\n']

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

view raw JSON →