/
githubmirror
/
flask
Обзор
Документация
Войти
/
githubmirror
/
flask
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/deploying/asgi.rst
27 строк
673 B
Resistor-git
Fix link to Hypercorn in docs/deploying/asgi.rst - they moved from gitlab from github.
28 окт 2023, 10:38
28 окт 2023, 10:38
be6ec06
Код
Авторство
О чём код?
ASGI ==== If you'd like to use an ASGI server you will need to utilise WSGI to ASGI middleware. The asgiref `WsgiToAsgi <https://github.com/django/asgiref#wsgi-to-asgi-adapter>`_ adapter is recommended as it integrates with the event loop used for Flask's :ref:`async_await` support. You can use the adapter by wrapping the Flask app, .. code-block:: python from asgiref.wsgi import WsgiToAsgi from flask import Flask app = Flask(__name__) ... asgi_app = WsgiToAsgi(app) and then serving the ``asgi_app`` with the ASGI server, e.g. using `Hypercorn <https://github.com/pgjones/hypercorn>`_, .. sourcecode:: text $ hypercorn module:asgi_app