summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlton Gibson <carlton.gibson@noumenal.es>2023-03-07 19:47:55 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-03-07 19:48:49 +0100
commitd89d517f90851654afb1073174b3c75d08452f3c (patch)
tree195a05f64f93d41eda990c3154342d79d7dca0d0
parent046d2b9edbc5730d961e7bc8ad293db8e60e8382 (diff)
downloaddjango-d89d517f90851654afb1073174b3c75d08452f3c.tar.gz
[4.2.x] Refs #31626 -- Noted that Daphne provides a runserver command.
Backport of 279e611c017b5fcc055263e760de1495a9098ede from main
-rw-r--r--docs/howto/deployment/asgi/daphne.txt19
-rw-r--r--docs/ref/django-admin.txt7
2 files changed, 26 insertions, 0 deletions
diff --git a/docs/howto/deployment/asgi/daphne.txt b/docs/howto/deployment/asgi/daphne.txt
index 5948288f07..48c0ab41c1 100644
--- a/docs/howto/deployment/asgi/daphne.txt
+++ b/docs/howto/deployment/asgi/daphne.txt
@@ -33,3 +33,22 @@ For a typical Django project, invoking Daphne would look like:
This will start one process listening on ``127.0.0.1:8000``. It requires that
your project be on the Python path; to ensure that run this command from the
same directory as your ``manage.py`` file.
+
+.. _daphne-runserver:
+
+Integration with ``runserver``
+==============================
+
+Daphne provides a :djadmin:`runserver` command to serve your site under ASGI
+during development.
+
+This can be enabled by adding ``daphne`` to the start of your
+:setting:`INSTALLED_APPS` and adding an ``ASGI_APPLICATION`` setting pointing
+to your ASGI application object::
+
+ INSTALLED_APPS = [
+ "daphne",
+ ...,
+ ]
+
+ ASGI_APPLICATION = "myproject.asgi.application"
diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt
index f757ce16d9..bda8aba7b5 100644
--- a/docs/ref/django-admin.txt
+++ b/docs/ref/django-admin.txt
@@ -1019,6 +1019,13 @@ By default, the development server doesn't serve any static files for your site
you want to configure Django to serve static media, read
:doc:`/howto/static-files/index`.
+Serving with ASGI in development
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Django's ``runserver`` command provides a WSGI server. In order to run under
+ASGI you will need to use an :doc:`ASGI server </howto/deployment/asgi/index>`.
+The Django Daphne project provides :ref:`daphne-runserver` that you can use.
+
``sendtestemail``
-----------------