asgi.rst
This file
Path
docs/deploying/asgi.rst
27 lines · 673 bytes
Last changed by
Update link to hypercorn (#5313)David Lordbefore adoption8d9519d
History of this fileTake it
1ASGI2====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://github.com/pgjones/hypercorn>`_,2425.. sourcecode:: text2627 $ hypercorn module:asgi_app