Opened 43 minutes ago
#36776 new Cleanup/optimization
Note that the dev server is running in WSGI mode
| Reported by: | Matthew Pava | Owned by: | |
|---|---|---|---|
| Component: | Documentation | Version: | 6.0 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
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.