Configure Contrast WSGI middleware for the Python agent

WSGI middleware is implemented as a class that wraps the application instance. (This is also the basis for both Flask and Pylons middleware.)

# This line imports the Contrast middleware class from the package
from contrast.agent.middlewares.wsgi_middleware import WSGIMiddleware as ContrastMiddleware

# other app code

app = get_wsgi_application()

# This line wraps the application instance with the Contrast middleware
app = ContrastMiddleware(app)

See the WSGI spec for additional details on WSGI middleware.