Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

[Django] #35591: Add warning to runserver that is should not be used for production

3 views
Skip to first unread message

Django

unread,
Jul 11, 2024, 3:31:32 AM7/11/24
to django-...@googlegroups.com
#35591: Add warning to runserver that is should not be used for production
-------------------------------------+-------------------------------------
Reporter: Andy Miller | Type:
| Uncategorized
Status: new | Component: Core
| (Management commands)
Version: dev | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
As per this discussion on the [https://forum.djangoproject.com/t/proposal-
borrow-warning-from-werkzeug-for-runserver/32668 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)
--
Ticket URL: <https://code.djangoproject.com/ticket/35591>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 11, 2024, 4:30:27 AM7/11/24
to django-...@googlegroups.com
#35591: Add warning to runserver that is should not be used for production
-------------------------------------+-------------------------------------
Reporter: Andy Miller | Owner: (none)
Type: | Status: new
Cleanup/optimization |
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: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* stage: Unreviewed => Accepted
* type: Uncategorized => Cleanup/optimization

Comment:

I think it's worth highlighting that it does say "development server":
{{{
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
}}}
We also have a warning in the [https://docs.djangoproject.com/en/5.0/ref
/django-admin/#runserver runserver docs] and a
[https://docs.djangoproject.com/en/5.0/intro/tutorial01/#the-development-
server 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
--
Ticket URL: <https://code.djangoproject.com/ticket/35591#comment:1>
Reply all
Reply to author
Forward
0 new messages