aiohttp-middlewares¶
Collection of useful middlewares for aiohttp.web applications.
Works on Python 3.8+
Works with aiohttp.web 3.8.1+
BSD licensed
Latest documentation on Read The Docs
Source, issues, and pull requests on GitHub
Quick Start¶
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.
Installation¶
pip install aiohttp-middlewares
Or using poetry:
poetry add aiohttp-middlewares
License¶
aiohttp-middlewares is licensed under the terms of BSD License.
Contents¶
- List of Middlewares
- API Reference
- Changelog
- 2.4.0 (2024-08-14)
- 2.3.0 (2024-02-11)
- 2.2.1 (2023-11-23)
- 2.2.0 (2022-10-26)
- 2.1.1 (2022-10-23)
- 2.1.0 (2022-07-25)
- 2.0.0 (2022-06-22)
- 1.2.1 (2021-11-06)
- 1.2.0 (2021-11-01)
- 1.1.0 (2020-04-21)
- 1.0.0 (2020-01-14)
- 0.3.1 (2019-11-13)
- 0.3.0 (2019-11-12)
- 0.2.0 (2019-07-23)
- 0.1.1 (2018-05-25)
- 0.1.0 (2018-02-20)