hypercorn.txt 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. ================================
  2. How to use Django with Hypercorn
  3. ================================
  4. Hypercorn_ is an ASGI server that supports HTTP/1, HTTP/2, and HTTP/3
  5. with an emphasis on protocol support.
  6. Installing Hypercorn
  7. ====================
  8. You can install Hypercorn with ``pip``:
  9. .. code-block:: shell
  10. python -m pip install hypercorn
  11. Running Django in Hypercorn
  12. ===========================
  13. When :pypi:`Hypercorn` is installed, a ``hypercorn`` command is available
  14. which runs ASGI applications. Hypercorn needs to be called with the
  15. location of a module containing an ASGI application object, followed
  16. by what the application is called (separated by a colon).
  17. For a typical Django project, invoking Hypercorn would look like:
  18. .. code-block:: shell
  19. hypercorn myproject.asgi:application
  20. This will start one process listening on ``127.0.0.1:8000``. It
  21. requires that your project be on the Python path; to ensure that run
  22. this command from the same directory as your ``manage.py`` file.
  23. For more advanced usage, please read the `Hypercorn documentation
  24. <Hypercorn_>`_.
  25. .. _Hypercorn: https://hypercorn.readthedocs.io/