Skip to main content

Collection of useful middlewares for aiohttp applications.

Project description

CI Workflow pre-commit black Latest Version Python versions BSD License Coverage Documentation

Collection of useful middlewares for aiohttp.web applications.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiohttp-middlewares-2.0.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

aiohttp_middlewares-2.0.0-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file aiohttp-middlewares-2.0.0.tar.gz.

File metadata

  • Download URL: aiohttp-middlewares-2.0.0.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for aiohttp-middlewares-2.0.0.tar.gz
Algorithm Hash digest
SHA256 e08ba04dc0e8fe379aa5e9444a68485c275677ee1e18c55cbb855de0c3629502
MD5 6144ca06cc3a89d70026e5fb1941f946
BLAKE2b-256 0ac208897c38b229cfb721fbad6c98c2ee9022b86c0c967f9d9edf3f3d7a1019

See more details on using hashes here.

File details

Details for the file aiohttp_middlewares-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aiohttp_middlewares-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 29cf1513176b4013844711975ff520e26a8a5d8f9fefbbddb5e91224a86b043e
MD5 1bfa2b804e5e1783608f80dfc3681793
BLAKE2b-256 d3db1b5c8e166a0cabf75460e5e388cbe5f4c122627d23463b5ab8745cc1c9af

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page