Registry / web-framework / paste
library3.10.1pypypi✓ verified 21d ago

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.

pip install paste
INSTALL
IMPORT
SIG · PASTE
P
paste
web-frameworkpythonv3.10.1
Install
1.9s avg
Import
142ms
Disk
21MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.10.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.138s · 19.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.9s · import 0.146s · 20MB
21MB installed
● package 21MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

serve
from paste.httpserver import serve
Commonly used to run a WSGI application using Paste's HTTP server.
loadapp
from paste.deploy import loadapp
Used for loading WSGI applications from configuration files.

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)
paster --version
Debug
Known issues
breakingPython 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).
fix
Upgrade your Python environment to Python 3 or downgrade Paste to a compatible version if Python 2 is unavoidable.
affects: >=3.7.0
gotchaThe `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.
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.
affects: >=3.10.0
gotchaBeginning 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.
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.
affects: >=3.10.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'paste'
The 'paste' library is not installed in the Python environment, or the Python interpreter cannot find it in its search path.
fix
Install the 'paste' library using pip: `pip install paste`
ImportError: cannot import name deploy
The 'PasteDeploy' component, often used with 'paste' for WSGI application configuration, is either not installed, installed incorrectly, or there's a version incompatibility.
fix
Ensure PasteDeploy is installed and up-to-date: `pip install -U PasteDeploy`
Target WSGI script '...' cannot be loaded as Python module
This generic WSGI error often occurs in environments using PasteDeploy (or other WSGI servers) when the specified WSGI application file (e.g., a .wsgi file) has a syntax error, an internal import error, or cannot be properly located or executed by the WSGI server.
fix
Check the Python code within your WSGI script for syntax errors, missing imports, or incorrect paths. Also, verify that the WSGI script path in your server configuration (e.g., Apache's `WSGIScriptAlias`) is correct and that the file has appropriate permissions.
Upgrade
Version history
3.10.1latest on PyPI · released May 1, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
3 hits · last 30 days
node
2
Resources
paste — pip install paste · libregistry