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
File details
Details for the file aiohttp_middlewares-2.1.1.tar.gz
.
File metadata
- Download URL: aiohttp_middlewares-2.1.1.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbd20765d55ba670ef6e1c176b9cca27a4caa9e332e24a8a1febbe8b5edb13d2 |
|
MD5 | abc75a705d141d90ba126d7366569b9c |
|
BLAKE2b-256 | 8727326e3e8ec4fbec2c1ab2024eb0e5328db73321287e97e406ed32afbdd69f |
Provenance
File details
Details for the file aiohttp_middlewares-2.1.1-py3-none-any.whl
.
File metadata
- Download URL: aiohttp_middlewares-2.1.1-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30237ca9669517a5b5bec0a65c2558edf65fa22f402db5cc8e0f8f4aef0e1040 |
|
MD5 | cf22cb61c1cd4c2d5cb18f1999637aef |
|
BLAKE2b-256 | 66001b37b6716b3185ed4d1722e0fbf823b81cb0dfa35e69aca29477ea0a99e7 |