uvicorn.txt 1.0 KB

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