[Django] #36776: Note that the dev server is running in WSGI mode

10 views
Skip to first unread message

Django

unread,
Dec 4, 2025, 7:23:19 PM12/4/25
to django-...@googlegroups.com
#36776: Note that the dev server is running in WSGI mode
-------------------------------------+-------------------------------------
Reporter: Matthew Pava | Type:
| Cleanup/optimization
Status: new | Component:
| Documentation
Version: 6.0 | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
With the mass adoption of async Django on the way, we need to provide a
clearer warning in the development server that it is running in WSGI mode
and not ASGI mode. I spent an hour troubleshooting a warning because I
created a middleware that was async only. Only when I made it compatible
for both async and sync modes did the warning go away.

Or we could just make the Django dev server default to ASGI mode.

Actual result:
The Django server displays this warning:
WARNING: This is a development server. Do not use it in a production
setting. Use a production WSGI or ASGI server instead.
For more information on production servers see:
https://docs.djangoproject.com/en/6.0/howto/deployment/

Desired result:
Revise it to something like:
WARNING: This is a development server that is running only in sync mode
(WSGI). Only middleware that is compatible with sync mode (WSGI) will run
properly. Do not use it in a production setting. Use a production WSGI or
ASGI server instead.
--
Ticket URL: <https://code.djangoproject.com/ticket/36776>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 6, 2025, 6:11:31 AM12/6/25
to django-...@googlegroups.com
#36776: Note that the dev server is running in WSGI mode
-------------------------------------+-------------------------------------
Reporter: Matthew Pava | Owner: Parvez
Type: | Khan
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Parvez Khan):

* owner: (none) => Parvez Khan
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/36776#comment:1>

Django

unread,
Dec 8, 2025, 5:04:02 PM12/8/25
to django-...@googlegroups.com
#36776: Note that the dev server is running in WSGI mode
-------------------------------------+-------------------------------------
Reporter: Matthew Pava | Owner: Parvez
Type: | Khan
Cleanup/optimization | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* component: Documentation => Core (Management commands)
* stage: Unreviewed => Accepted
* version: 6.0 => dev

Comment:

In general, this seems fine to tweak. I checked Daphne's `runserver`
output, and it looks like:

{{{
Starting ASGI/Daphne version 4.2.1 development server at
http://127.0.0.1:8000/
}}}

So I'd be happy to change Django's to:
{{{#!diff
diff --git a/django/core/management/commands/runserver.py
b/django/core/management/commands/runserver.py
index 0cf841b747..260badce5c 100644
--- a/django/core/management/commands/runserver.py
+++ b/django/core/management/commands/runserver.py
@@ -184,7 +184,7 @@ class Command(BaseCommand):
print(
f"{now}\n"
f"Django version {version}, using settings
{settings.SETTINGS_MODULE!r}\n"
- f"Starting development server at
{self.protocol}://{addr}:{server_port}/\n"
+ f"Starting WSGI development server at
{self.protocol}://{addr}:{server_port}/\n"
f"Quit the server with {quit_command}.",
file=self.stdout,
)
}}}

However, mixing this information up with the security warning doesn't seem
appropriate to me, nor taking a detour into middleware.
--
Ticket URL: <https://code.djangoproject.com/ticket/36776#comment:2>

Django

unread,
Dec 8, 2025, 5:28:28 PM12/8/25
to django-...@googlegroups.com
#36776: Note that the dev server is running in WSGI mode
-------------------------------------+-------------------------------------
Reporter: Matthew Pava | Owner: Parvez
Type: | Khan
Cleanup/optimization | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Matthew Pava):

That's fine. Can we also update the middleware documentation with some
note that the development server only supports sync middleware?
https://docs.djangoproject.com/en/6.0/topics/http/middleware/
--
Ticket URL: <https://code.djangoproject.com/ticket/36776#comment:3>

Django

unread,
Dec 8, 2025, 5:34:51 PM12/8/25
to django-...@googlegroups.com
#36776: Note that the dev server is running in WSGI mode
-------------------------------------+-------------------------------------
Reporter: Matthew Pava | Owner: Parvez
Type: | Khan
Cleanup/optimization | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls):

Either there or on the async support page seems reasonable.
--
Ticket URL: <https://code.djangoproject.com/ticket/36776#comment:4>

Django

unread,
Dec 9, 2025, 4:05:04 AM12/9/25
to django-...@googlegroups.com
#36776: Note that the dev server is running in WSGI mode
-------------------------------------+-------------------------------------
Reporter: Matthew Pava | Owner: Parvez
Type: | Khan
Cleanup/optimization | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Clifford Gama):

* needs_better_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/36776#comment:5>

Django

unread,
Dec 18, 2025, 8:06:09 PM12/18/25
to django-...@googlegroups.com
#36776: Note that the dev server is running in WSGI mode
-------------------------------------+-------------------------------------
Reporter: Matthew Pava | Owner: Parvez
Type: | Khan
Cleanup/optimization | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Nilesh Pahari):

* has_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/36776#comment:6>

Django

unread,
Dec 18, 2025, 8:15:52 PM12/18/25
to django-...@googlegroups.com
#36776: Note that the dev server is running in WSGI mode
-------------------------------------+-------------------------------------
Reporter: Matthew Pava | Owner: Parvez
Type: | Khan
Cleanup/optimization | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Nilesh Pahari):

* has_patch: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/36776#comment:7>

Django

unread,
Jan 23, 2026, 8:42:06 PM (15 hours ago) Jan 23
to django-...@googlegroups.com
#36776: Note that the dev server is running in WSGI mode
-------------------------------------+-------------------------------------
Reporter: Matthew Pava | Owner: Parvez
Type: | Khan
Cleanup/optimization | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by irshadirshu0722):

Hi, I’d like to work on this by adding a documentation note about the
development server running in WSGI (sync) mode, as suggested above.
--
Ticket URL: <https://code.djangoproject.com/ticket/36776#comment:8>
Reply all
Reply to author
Forward
0 new messages