From ef69acd76b592353eaa5ae3fef3a76da9b2c431a Mon Sep 17 00:00:00 2001 From: vtino17 Date: Wed, 22 Jul 2026 14:54:48 +0700 Subject: [PATCH] Improve dev server warning message to include deployment options --- docs/deploying/index.rst | 7 +++---- docs/server.rst | 9 ++++----- src/flask/app.py | 7 ++++--- src/flask/cli.py | 7 ++++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/deploying/index.rst b/docs/deploying/index.rst index dcef8abe08..cc6e3b9dcf 100644 --- a/docs/deploying/index.rst +++ b/docs/deploying/index.rst @@ -9,10 +9,9 @@ WSGI server or hosting platform, some of which will be described here. "Production" means "not development", which applies whether you're serving your application publicly to millions of users or privately / -locally to a single user. **Do not use the development server when -deploying to production. It is intended for use only during local -development. It is not designed to be particularly secure, stable, or -efficient.** +locally to a single user. **This is a development server. Do not use +it in a production deployment. It is not designed to be particularly +secure, stable, or efficient.** Self-Hosted Options ------------------- diff --git a/docs/server.rst b/docs/server.rst index d6beb1d86d..5854e2404b 100644 --- a/docs/server.rst +++ b/docs/server.rst @@ -9,11 +9,10 @@ changed. .. warning:: - Do not use the development server when deploying to production. It - is intended for use only during local development. It is not - designed to be particularly efficient, stable, or secure. - - See :doc:`/deploying/index` for deployment options. + This is a development server. Do not use it in a production + deployment. It is not designed to be particularly secure, + stable, or efficient. See :doc:`/deploying/index` for + deployment options. Command Line ------------ diff --git a/src/flask/app.py b/src/flask/app.py index 652b9bbf71..7d39c342f7 100644 --- a/src/flask/app.py +++ b/src/flask/app.py @@ -639,9 +639,10 @@ def run( ) -> None: """Runs the application on a local development server. - Do not use ``run()`` in a production setting. It is not intended to - meet security and performance requirements for a production server. - Instead, see :doc:`/deploying/index` for WSGI server recommendations. + This is a development server. Do not use it in a production + deployment. It is not designed to be particularly secure, + stable, or efficient. See :doc:`/deploying/index` for WSGI + server recommendations. If the :attr:`debug` flag is set the server will automatically reload for code changes and show a debugger in case an exception happened. diff --git a/src/flask/cli.py b/src/flask/cli.py index 1a9159ec7c..bc05cd1367 100644 --- a/src/flask/cli.py +++ b/src/flask/cli.py @@ -943,10 +943,11 @@ def run_command( extra_files: list[str] | None, exclude_patterns: list[str] | None, ) -> None: - """Run a local development server. + """Run a development server. - This server is for development purposes only. It does not provide - the stability, security, or performance of production WSGI servers. + This is a development server. Do not use it in a production + deployment. It is not designed to be particularly secure, + stable, or efficient. Use a production WSGI server instead. The reloader and debugger are enabled by default with the '--debug' option.