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.

  • Works on Python 3.6+

  • Works with aiohttp 3.5+

  • BSD licensed

  • Latest documentation on Read The Docs

  • Source, issues, and pull requests on GitHub

Quickstart

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

Uploaded Source

Built Distribution

aiohttp_middlewares-1.1.0-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiohttp-middlewares-1.1.0.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for aiohttp-middlewares-1.1.0.tar.gz
Algorithm Hash digest
SHA256 4a58c090ea50f44ae49a8ce1dc79f7366b8b6223f179f499bc97f399751efeed
MD5 7e0fa7dba61134bd0924648c983312b7
BLAKE2b-256 5fc38f80640739907ca7db46c7f1eb7e7f189cf23e19a02a85f58f7b732d7d65

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: aiohttp_middlewares-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for aiohttp_middlewares-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 47080da0eaa8dee0f3d26ce781959b077b79dd063f45308f5e93fd4134f1c683
MD5 4f8c3313c6e95d180625e74bdbd3b2ed
BLAKE2b-256 de3a2df38a92b5c4a919234461502d03b8652b19f3007c31980ca0d941673fe2

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