mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
[4.2.x] Refs #34140 -- Applied rst code-block to non-Python examples.
Thanks to J.V. Zammit, Paolo Melchiorre, and Mariusz Felisiak for
reviews.
Backport of 534ac48297 from main.
This commit is contained in:
committed by
Mariusz Felisiak
parent
4a89aa25c9
commit
b784768eef
@@ -2,8 +2,6 @@
|
||||
How to use Django with Daphne
|
||||
=============================
|
||||
|
||||
.. highlight:: bash
|
||||
|
||||
Daphne_ is a pure-Python ASGI server for UNIX, maintained by members of the
|
||||
Django project. It acts as the reference server for ASGI.
|
||||
|
||||
@@ -12,7 +10,9 @@ Django project. It acts as the reference server for ASGI.
|
||||
Installing Daphne
|
||||
===================
|
||||
|
||||
You can install Daphne with ``pip``::
|
||||
You can install Daphne with ``pip``:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
python -m pip install daphne
|
||||
|
||||
@@ -24,7 +24,9 @@ Daphne server process. At its simplest, Daphne needs to be called with the
|
||||
location of a module containing an ASGI application object, followed by what
|
||||
the application is called (separated by a colon).
|
||||
|
||||
For a typical Django project, invoking Daphne would look like::
|
||||
For a typical Django project, invoking Daphne would look like:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
daphne myproject.asgi:application
|
||||
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
How to use Django with Hypercorn
|
||||
================================
|
||||
|
||||
.. highlight:: bash
|
||||
|
||||
Hypercorn_ is an ASGI server that supports HTTP/1, HTTP/2, and HTTP/3
|
||||
with an emphasis on protocol support.
|
||||
|
||||
Installing Hypercorn
|
||||
====================
|
||||
|
||||
You can install Hypercorn with ``pip``::
|
||||
You can install Hypercorn with ``pip``:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
python -m pip install hypercorn
|
||||
|
||||
@@ -22,7 +22,9 @@ which runs ASGI applications. Hypercorn needs to be called with the
|
||||
location of a module containing an ASGI application object, followed
|
||||
by what the application is called (separated by a colon).
|
||||
|
||||
For a typical Django project, invoking Hypercorn would look like::
|
||||
For a typical Django project, invoking Hypercorn would look like:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
hypercorn myproject.asgi:application
|
||||
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
How to use Django with Uvicorn
|
||||
==============================
|
||||
|
||||
.. highlight:: bash
|
||||
|
||||
Uvicorn_ is an ASGI server based on ``uvloop`` and ``httptools``, with an
|
||||
emphasis on speed.
|
||||
|
||||
Installing Uvicorn
|
||||
==================
|
||||
|
||||
You can install Uvicorn with ``pip``::
|
||||
You can install Uvicorn with ``pip``:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
python -m pip install uvicorn
|
||||
|
||||
@@ -22,7 +22,9 @@ applications. Uvicorn needs to be called with the location of a module
|
||||
containing an ASGI application object, followed by what the application is
|
||||
called (separated by a colon).
|
||||
|
||||
For a typical Django project, invoking Uvicorn would look like::
|
||||
For a typical Django project, invoking Uvicorn would look like:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
python -m uvicorn myproject.asgi:application
|
||||
|
||||
@@ -41,11 +43,15 @@ Deploying Django using Uvicorn and Gunicorn
|
||||
Gunicorn_ is a robust web server that implements process monitoring and automatic
|
||||
restarts. This can be useful when running Uvicorn in a production environment.
|
||||
|
||||
To install Uvicorn and Gunicorn, use the following::
|
||||
To install Uvicorn and Gunicorn, use the following:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
python -m pip install uvicorn gunicorn
|
||||
|
||||
Then start Gunicorn using the Uvicorn worker class like this::
|
||||
Then start Gunicorn using the Uvicorn worker class like this:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
python -m gunicorn myproject.asgi:application -k uvicorn.workers.UvicornWorker
|
||||
|
||||
|
||||
Reference in New Issue
Block a user