asgi.rst
This file
Path
docs/deploying/asgi.rst
29 lines · 684 bytes
Last changed by
Merge remote-tracking branch 'origin/2.0.x'David Lordbefore adoptionafc13b9
History of this fileTake it
Merge pull request #3967 from pgjones/docsDavid Lordbefore adoption03db919
lines 1–7why, one step back1.. _asgi:23ASGI4====56If you'd like to use an ASGI server you will need to utilise WSGI to7ASGI middleware. The asgirefMerge remote-tracking branch 'origin/2.0.x'David Lordbefore adoptionafc13b9
line 8why, one step back8`WsgiToAsgi <https://github.com/django/asgiref#wsgi-to-asgi-adapter>`_Merge pull request #3967 from pgjones/docsDavid Lordbefore adoption03db919
lines 9–23why, one step back9adapter is recommended as it integrates with the event loop used for10Flask's :ref:`async_await` support. You can use the adapter by11wrapping the Flask app,1213.. code-block:: python1415 from asgiref.wsgi import WsgiToAsgi16 from flask import Flask1718 app = Flask(__name__)1920 ...2122 asgi_app = WsgiToAsgi(app)23Merge remote-tracking branch 'origin/2.0.x'David Lordbefore adoptionafc13b9
line 24why, one step back24and then serving the ``asgi_app`` with the ASGI server, e.g. usingMerge pull request #3967 from pgjones/docsDavid Lordbefore adoption03db919
lines 25–29why, one step back25`Hypercorn <https://gitlab.com/pgjones/hypercorn>`_,2627.. sourcecode:: text2829 $ hypercorn module:asgi_app