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.4.0.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

aiohttp_middlewares-2.4.0-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file aiohttp_middlewares-2.4.0.tar.gz.

File metadata

  • Download URL: aiohttp_middlewares-2.4.0.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for aiohttp_middlewares-2.4.0.tar.gz
Algorithm Hash digest
SHA256 ee240fc21b7eb9154b4447e4bc9bab7b212584d93a35aa8f56333c79ca3cd0e8
MD5 b67669afea92784391343907d119a33d
BLAKE2b-256 85800ab3fd35f522ad5bec9e069871717a6c70f28df24e964a1f70c158878133

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for aiohttp_middlewares-2.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c71a7ca1af6f704aad9e6851c8f12debac7c2aac28aa11a5905f45e39370a490
MD5 0c3512367ae483f1a7f2fe8227bb9d58
BLAKE2b-256 407a501b1865520c35d2e88c6925da7e4e1453e8e3d526b66bae68dc31f44599

See more details on using hashes here.

Provenance

Supported by

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