Metadata-Version: 2.1
Name: aiohttp-middlewares
Version: 1.0.0b0
Summary: Collection of useful middlewares for aiohttp applications.
Home-page: https://igordavydenko.com/projects.html#aiohttp-middlewares
License: BSD-3-Clause
Keywords: aiohttp,middlewares
Author: Igor Davydenko
Author-email: iam@igordavydenko.com
Requires-Python: >=3.6,<4.0
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
Classifier: Topic :: Utilities
Requires-Dist: aiohttp (>=3.5,<4.0)
Requires-Dist: async-timeout (>=1.2,<4)
Project-URL: Documentation, https://aiohttp-middlewares.readthedocs.io/
Project-URL: Repository, https://github.com/playpauseandstop/aiohttp-middlewares
Description-Content-Type: text/x-rst

===================
aiohttp-middlewares
===================

.. image:: https://img.shields.io/circleci/project/github/playpauseandstop/aiohttp-middlewares/master.svg
    :target: https://circleci.com/gh/playpauseandstop/aiohttp-middlewares
    :alt: CircleCI

.. image:: https://img.shields.io/pypi/v/aiohttp-middlewares.svg
    :target: https://pypi.org/project/aiohttp-middlewares/
    :alt: Latest Version

.. image:: https://img.shields.io/pypi/pyversions/aiohttp-middlewares.svg
    :target: https://pypi.org/project/aiohttp-middlewares/
    :alt: Python versions

.. image:: https://img.shields.io/pypi/l/aiohttp-middlewares.svg
    :target: https://github.com/playpauseandstop/aiohttp-middlewares/blob/master/LICENSE
    :alt: BSD License

.. image:: https://coveralls.io/repos/playpauseandstop/aiohttp-middlewares/badge.svg?branch=master&service=github
    :target: https://coveralls.io/github/playpauseandstop/aiohttp-middlewares
    :alt: Coverage

.. image:: https://readthedocs.org/projects/aiohttp-middlewares/badge/?version=latest
    :target: http://aiohttp-middlewares.readthedocs.org/en/latest/
    :alt: Documentation

Collection of useful middlewares for `aiohttp <http://aiohttp.readthedocs.org/>`_
applications.

- Works on Python 3.6+
- Works with aiohttp 3.5+
- BSD licensed
- Latest documentation `on Read The Docs
  <https://aiohttp-middlewares.readthedocs.io/>`_
- Source, issues, and pull requests `on GitHub
  <https://github.com/playpauseandstop/aiohttp-middlewares>`_

Quickstart
==========

By default ``aiohttp.web`` does not provide many built-in middlewares for
standart web development actions such as handling errors, shielding view
handlers, or providing CORS headers.

``aiohttp-middlewares`` 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`` and handle
errors for ``aiohttp.web`` application you need to,

.. code-block:: python

    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 <https://aiohttp-middlewares.readthedocs.io/>`_ for
all available middlewares and available initialization options.

