#35591 closed Cleanup/optimization (fixed)
Add warning to runserver that it should not be used for production
Reported by: | Andy Miller | Owned by: | Andy Miller |
---|---|---|---|
Component: | Core (Management commands) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Andy Miller, Ülgen Sarıkavak | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
As per this discussion on the forum, I think adding a warning to the start of runserver would be valuable to those new to Django and a healthy reminder to those coming back to Django.
The wording of the warning is:
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. For more information on production servers see the documentation: https://docs.djangoproject.com/en/5.0/howto/deployment/
Additionally a flag should be added to optionally hide the warning. --hide-unsuitable-for-production
was a suggestion.
Finally the following 2 pages of the documentation should have add some wording to highlight that a deployed project should not use runserver.
- https://docs.djangoproject.com/en/5.0/howto/deployment/ (Add a warning or paragraph that mentions switching)
- https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/ (Add a section to switch away from runserver)
Change History (16)
comment:1 by , 4 months ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Type: | Uncategorized → Cleanup/optimization |
comment:2 by , 4 months ago
Summary: | Add warning to runserver that is should not be used for production → Add warning to runserver that it should not be used for production |
---|
comment:3 by , 4 months ago
Owner: | set to |
---|---|
Status: | new → assigned |
This will be the new output by default. Warning can be disabled by using --hide-unsuitable-for-production
flag
Starting development server at http://127.0.0.1:8000/ Quit the server with CTRL-BREAK. WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. For more information on production servers see the documentation: https://docs.djangoproject.com/en/5.0/howto/deployment/
comment:4 by , 4 months ago
Cc: | added |
---|
comment:5 by , 3 months ago
Task list:
- add flag to runserver command
- add new message with flag to hide it
- update output at https://docs.djangoproject.com/en/5.0/intro/tutorial01/#the-development-server
- update reference docs: https://docs.djangoproject.com/en/5.0/ref/django-admin/#runserver
- update deployment checklist
- update deployment docs with a warning
- add tests for new flag
- update existing tests to include extended output
comment:7 by , 3 months ago
Has patch: | set |
---|
comment:8 by , 3 months ago
Patch needs improvement: | set |
---|
comment:12 by , 3 months ago
Patch needs improvement: | set |
---|
comment:13 by , 3 months ago
Patch needs improvement: | unset |
---|
comment:14 by , 3 months ago
Triage Stage: | Accepted → Ready for checkin |
---|
I think it's worth highlighting that it does say "development server":
We also have a warning in the runserver docs and a warning in the tutorial (note that the tutorial runserver output would need to be updated if we make a change here).
So I think this is not that we don't have this already but a request to make this information more prominent