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

Uploaded Source

Built Distribution

aiohttp_middlewares-2.3.0-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiohttp_middlewares-2.3.0.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for aiohttp_middlewares-2.3.0.tar.gz
Algorithm Hash digest
SHA256 b2564c1dfa8dbcf7d2e101a6a03dcaad45464744531c269e8e582cb2dc551d08
MD5 db31dc1cf62b01ed71731275e912ea72
BLAKE2b-256 f6614507a56202165dfb7bee96d043cf80059fb68930d8be3ea45a5281e9c01f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for aiohttp_middlewares-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4424b136a351b67b4c93da7d7505b56a342addaa324be30793f6cba463d18ac8
MD5 15a109efa593451d3a0484e7e740719a
BLAKE2b-256 3bb9ae8df6696d26c8c6de48f607030716d798883e9e418be4f535cfa84626d9

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