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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3967b2a0d17a2c094681e7c2f246977a365479a2820e48f8a01136c910f4aa93 |
|
MD5 | 1bdf55634fd77d1bdd1f5962a850b6c3 |
|
BLAKE2b-256 | bfd0ad1887bca385f2849681a119409925a4e57d4822fd7ec646b3dc9321614d |
Hashes for aiohttp_middlewares-2.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4b87665667d4d3e818d70495e832e368f11a1fdc9c2fd8157a7d9e5d5147c5d |
|
MD5 | 2d636b8aac47b067ed303d28175b5c7c |
|
BLAKE2b-256 | 475335318ac718970d276f277565a4821d47759ab17ee00e1b16d46c85481e98 |