{"id":4676,"library":"paste","title":"Paste (WSGI Toolkit)","description":"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.","status":"active","version":"3.10.1","language":"en","source_language":"en","source_url":"https://github.com/pasteorg/paste","tags":["wsgi","web","server","toolkit","deployment"],"install":[{"cmd":"pip install paste","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"note":"Commonly used to run a WSGI application using Paste's HTTP server.","symbol":"serve","correct":"from paste.httpserver import serve"},{"note":"Used for loading WSGI applications from configuration files.","symbol":"loadapp","correct":"from paste.deploy import loadapp"}],"quickstart":{"code":"from paste.httpserver import serve\n\ndef simple_app(environ, start_response):\n    status = '200 OK'\n    headers = [('Content-type', 'text/plain; charset=utf-8')]\n    start_response(status, headers)\n    return [b'Hello, Paste!\\n']\n\nif __name__ == '__main__':\n    print(\"Serving on http://127.0.0.1:8000\")\n    serve(simple_app, host='127.0.0.1', port=8000)","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade your Python environment to Python 3 or downgrade Paste to a compatible version if Python 2 is unavoidable.","message":"Python 2 compatibility was completely removed starting with Paste versions 3.7.0 and 3.8.0. If you require Python 2 support, you must use an older version of Paste (e.g., 3.6.1 or earlier).","severity":"breaking","affected_versions":">=3.7.0"},{"fix":"Review usage of `cgi.escape` and consider migrating to `html.escape` or `paste.util`'s implementations if you were explicitly using or extending Paste's `cgi` module wrappers.","message":"The `cgi.escape` function, which was deprecated and later removed in Python 3, has been replaced internally by Paste in version 3.10.0. If your application or custom Paste extensions relied on specific behaviors of `cgi.escape` through Paste, inspect `paste.util` for alternatives.","severity":"gotcha","affected_versions":">=3.10.0"},{"fix":"For better long-term compatibility when using `cgitb.Hook` or `cgi.FieldStorage` in conjunction with Paste, consider importing them from `paste.util` instead of the standard `cgi` module.","message":"Beginning with version 3.10.0, Paste started including `cgitb.Hook` and `cgi.FieldStorage` in `paste.util`. While this provides compatibility, direct reliance on the standard library's `cgi` module for these functions may lead to issues with future Python versions, as the `cgi` module itself is undergoing changes and potential deprecation.","severity":"gotcha","affected_versions":">=3.10.0"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}