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 fileTake it
The walk stopped after 200 commits: lines older than 4240ace point at it.
Merge remote-tracking branch 'origin/2.0.x'David Lordbefore adoption4240ace
lines 1–5why, one step back1ASGI2====34If you'd like to use an ASGI server you will need to utilise WSGI to5ASGI middleware. The asgirefMerge remote-tracking branch 'origin/2.0.x'David Lordbefore adoptionafc13b9
line 6why, one step back6`WsgiToAsgi <https://github.com/django/asgiref#wsgi-to-asgi-adapter>`_Merge remote-tracking branch 'origin/2.0.x'David Lordbefore adoption4240ace
lines 7–21why, one step back7adapter 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)21Merge remote-tracking branch 'origin/2.0.x'David Lordbefore adoptionafc13b9
line 22why, one step back22and then serving the ``asgi_app`` with the ASGI server, e.g. usingMerge remote-tracking branch 'origin/2.0.x'David Lordbefore adoption4240ace
lines 23–27why, one step back23`Hypercorn <https://gitlab.com/pgjones/hypercorn>`_,2425.. sourcecode:: text2627 $ hypercorn module:asgi_app