Skip to content
Myr

asgi.rst

This file

Path

docs/deploying/asgi.rst

27 lines · 673 bytes

Last changed by

Merge branch '2.1.x'David Lordbefore adoption9139af1

History of this file

Take it

The walk stopped after 200 commits: lines older than 41aaaf7 point at it.

clean up unused function from prefixed_env prDavid Lordbefore adoption41aaaf7

lines 1–27why, one step back
1ASGI
2====34If you'd like to use an ASGI server you will need to utilise WSGI to5ASGI middleware. The asgiref6`WsgiToAsgi <https://github.com/django/asgiref#wsgi-to-asgi-adapter>`_7adapter is recommended as it integrates with the event loop used for8Flask's :ref:`async_await` support. You can use the adapter by9wrapping the Flask app,1011.. code-block:: python1213 from asgiref.wsgi import WsgiToAsgi14 from flask import Flask1516 app = Flask(__name__)1718 ...1920 asgi_app = WsgiToAsgi(app)2122and then serving the ``asgi_app`` with the ASGI server, e.g. using23`Hypercorn <https://gitlab.com/pgjones/hypercorn>`_,2425.. sourcecode:: text2627 $ hypercorn module:asgi_app