1
0
mirror of https://github.com/django/django.git synced 2025-06-03 18:49:12 +00:00

[5.2.x] Fixed #36266 -- Renamed HIDE_PRODUCTION_WARNING environment variable to DJANGO_RUNSERVER_HIDE_WARNING.

Backport of 5adadf6e8c74ab14d432e9d682ca1914789386de from main.
This commit is contained in:
Johanan Oppong Amoateng 2025-03-20 10:22:07 +00:00 committed by Sarah Boyce
parent d2b1ec5515
commit 321a5651a3
4 changed files with 5 additions and 4 deletions

View File

@ -189,7 +189,7 @@ class Command(BaseCommand):
file=self.stdout, file=self.stdout,
) )
docs_version = get_docs_version() docs_version = get_docs_version()
if os.environ.get("HIDE_PRODUCTION_WARNING") != "true": if os.environ.get("DJANGO_RUNSERVER_HIDE_WARNING") != "true":
self.stdout.write( self.stdout.write(
self.style.WARNING( self.style.WARNING(
"WARNING: This is a development server. Do not use it in a " "WARNING: This is a development server. Do not use it in a "

View File

@ -947,7 +947,7 @@ multithreaded by default.
Uses IPv6 for the development server. This changes the default IP address from Uses IPv6 for the development server. This changes the default IP address from
``127.0.0.1`` to ``::1``. ``127.0.0.1`` to ``::1``.
.. envvar:: HIDE_PRODUCTION_WARNING .. envvar:: DJANGO_RUNSERVER_HIDE_WARNING
.. versionadded:: 5.2 .. versionadded:: 5.2

View File

@ -276,7 +276,8 @@ Management Commands
* A new warning is displayed when running :djadmin:`runserver`, indicating that * A new warning is displayed when running :djadmin:`runserver`, indicating that
it is unsuitable for production. This warning can be suppressed by setting it is unsuitable for production. This warning can be suppressed by setting
the :envvar:`HIDE_PRODUCTION_WARNING` environment variable to ``"true"``. the :envvar:`DJANGO_RUNSERVER_HIDE_WARNING` environment variable to
``"true"``.
* The :djadmin:`makemigrations` and :djadmin:`migrate` commands have a new * The :djadmin:`makemigrations` and :djadmin:`migrate` commands have a new
``Command.autodetector`` attribute for subclasses to override in order to use ``Command.autodetector`` attribute for subclasses to override in order to use

View File

@ -1630,7 +1630,7 @@ class ManageRunserver(SimpleTestCase):
self.output.getvalue(), self.output.getvalue(),
) )
@mock.patch.dict(os.environ, {"HIDE_PRODUCTION_WARNING": "true"}) @mock.patch.dict(os.environ, {"DJANGO_RUNSERVER_HIDE_WARNING": "true"})
def test_hide_production_warning_with_environment_variable(self): def test_hide_production_warning_with_environment_variable(self):
self.cmd.addr = "0" self.cmd.addr = "0"
self.cmd._raw_ipv6 = False self.cmd._raw_ipv6 = False