Web Gateway Modules

wsgiref

Reference implementation of the synchronous WSGI interface between Python web applications and servers. An application accepts an environment mapping and start_response callback, and returns an iterable of bytes. The package includes helpers and a validator, not a production deployment stack.

Formal Syntax & Structure

python syntaxpython
import wsgiref

Return Value

module

Module namespace available through import; import is a statement, not a value-returning expression.

Working Example

Example Snippetpython
from wsgiref.util import setup_testing_defaultsenviron = {}setup_testing_defaults(environ)print(environ["REQUEST_METHOD"])
Python Reference