Collection of useful middlewares for aiohttp applications.
Project description
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.
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
File details
Details for the file aiohttp-middlewares-1.0.0b1.tar.gz
.
File metadata
- Download URL: aiohttp-middlewares-1.0.0b1.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.0 CPython/3.8.0 Linux/4.15.0-1052-aws
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc73759e24e0a0f2eab13ae435e8311d9e0b47a90bd9e8b5cf1f475f49ea01f6 |
|
MD5 | ed00a98b86c82c515ece4474aa7438e6 |
|
BLAKE2b-256 | 141f838b10c14553ce58010c093d87b49a49272a2007c6089da857b4afa13c78 |
Provenance
File details
Details for the file aiohttp_middlewares-1.0.0b1-py3-none-any.whl
.
File metadata
- Download URL: aiohttp_middlewares-1.0.0b1-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.0 CPython/3.8.0 Linux/4.15.0-1052-aws
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4f68eee283eb2d14297924d06231f9e7296551125266d2c22b8b1b4c707a15b |
|
MD5 | 9f8ff50bc259a0a4456d48373d569beb |
|
BLAKE2b-256 | 5cdb74ed3c0d157124235dc159c515aea52e9c5a0170aa89fd0db8067d6a43ec |