Skip to main content

Collection of useful middlewares for aiohttp applications.

Project description

CircleCI 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.0.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

aiohttp_middlewares-1.0.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiohttp-middlewares-1.0.0.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.8.0 Linux/4.15.0-1052-aws

File hashes

Hashes for aiohttp-middlewares-1.0.0.tar.gz
Algorithm Hash digest
SHA256 30ad64818332214134e03947d1990f7229775c0b8f5774c68c5b61bb0e7637c3
MD5 b1e98a9490f61d89c7371c758264fd3e
BLAKE2b-256 b3fb510138c29549a01d91f29ed0a939abfea0414663c3358d1bc7cf7f3e2e73

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for aiohttp_middlewares-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 12b2fa8744ec25d33c2b42c8ae4ad3b4f8b1a91ce730828047b6c3a2d41e830d
MD5 5824e29779ce79fca72954b70aa6515c
BLAKE2b-256 19a337bf863ec91fc1431ce4e74568ab11dfc94846980240af93e20661125411

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