Collection of useful middlewares for aiohttp applications.
Project description
Collection of useful middlewares for aiohttp.web applications.
Works on Python 3.7+
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for aiohttp_middlewares-2.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08676401858a6c8753e0205cd38f5101a4c35ec1c244ebb606162053be1b3572 |
|
MD5 | 804f17379f74779e796efde8605d41e8 |
|
BLAKE2b-256 | d485c6cd430248a9801aaef5d898b87251aef11edc61be80585fbf0c6e10c793 |
Hashes for aiohttp_middlewares-2.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 502c0f8c9581908fca43e066a829e1b4f7e910ebb504ad8aa995b0ba10b4dba1 |
|
MD5 | 8c1936be0b3d86e7ec439603f0a73c88 |
|
BLAKE2b-256 | 609bfdbafefcae62cc639c1bb410d113b41271437ab6982550ca29e6580e17a6 |