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

Uploaded Source

Built Distribution

aiohttp_middlewares-2.1.0-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiohttp-middlewares-2.1.0.tar.gz
  • Upload date:
  • Size: 14.6 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.1.0.tar.gz
Algorithm Hash digest
SHA256 5863970d944dc63faedc96ef324a7fe2bcefefebe29acc90cd641236322d00c3
MD5 fef3e59a63a3d69f2bf8ff47db166830
BLAKE2b-256 7e8c9a34a9ab658bcc50405d95e1a1229f0d6432682b2cf6da8fb3579ecbc354

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for aiohttp_middlewares-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c83d48702e6a8669981976f39a60e83d059dc01d7b1ee651aec5d4cb807ff784
MD5 7b53ab26af1cf8956ff26dd13ea033b6
BLAKE2b-256 d01f8e7b1e1e812628f8bd338784380212568117042b2e11821062f8482652a7

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