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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiohttp-middlewares-1.2.1.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for aiohttp-middlewares-1.2.1.tar.gz
Algorithm Hash digest
SHA256 ef540be1a5bb28703268c2ca5792cf02f70d11ff080c26a3aa22c4f44c1f055c
MD5 f2e3d6e66c864f534d71410f46f0d8b7
BLAKE2b-256 2839e994a351ad6c258922c3d65ee912f030f727c8dc6ef62bb12b92db932010

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: aiohttp_middlewares-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for aiohttp_middlewares-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5cefc4b11947bd5de9c6163abe473c57b8fd830e20ad2737f932f366946dc78a
MD5 f45339d18df1dfb28f7a66fe4f316e7c
BLAKE2b-256 1a2fbffde2c45ef2d9d49a4de72ef02882639d4fb8f6d74e1537b4f1bd708178

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