aiohttp-middlewares
Collection of useful middlewares for aiohttp.web applications.
- Works on Python 3.6+
- Works with aiohttp 3.5+
- BSD licensed
- Latest documentation on Read The Docs
- Source, issues, and pull requests on GitHub
Quickstart
By default aiohttp.web does not provide many built-in middlewares for
standart web-development needs such as: handling errors, shielding view
handlers, or providing CORS headers.
aiohttp-middlewares tries to fix this by providing several middlewares that
aims to cover most common web-development needs.
For example, to enable CORS headers for http://localhost:8081 origin and
handle errors for aiohttp.web application you need to,
from aiohttp import web
from aiohttp_middlewares import (
cors_middleware,
error_middleware,
)
app = web.Application(
middlewares=(
cors_middleware(origins=("http://localhost:8081",)),
error_middleware(),
)
)Check documentation for all available middlewares and available initialization options.

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
