settings: Print about custom settings from runtornado.

This commit is contained in:
Tim Abbott 2023-12-05 11:40:26 -08:00
parent 8a7916f21a
commit 9d3ef7f589
2 changed files with 7 additions and 6 deletions

View File

@ -98,6 +98,9 @@ class Command(BaseCommand):
set_current_port(port) set_current_port(port)
translation.activate(settings.LANGUAGE_CODE) translation.activate(settings.LANGUAGE_CODE)
if settings.CUSTOM_DEVELOPMENT_SETTINGS:
print("Using custom settings from zproject/custom_dev_settings.py.")
# We pass display_num_errors=False, since Django will # We pass display_num_errors=False, since Django will
# likely display similar output anyway. # likely display similar output anyway.
self.check(display_num_errors=False) self.check(display_num_errors=False)

View File

@ -14,6 +14,7 @@ from .default_settings import * # noqa: F403 isort: skip
from .config import PRODUCTION from .config import PRODUCTION
TEST_SUITE = os.getenv("ZULIP_TEST_SUITE") == "true" TEST_SUITE = os.getenv("ZULIP_TEST_SUITE") == "true"
CUSTOM_DEVELOPMENT_SETTINGS = False
if PRODUCTION: # nocoverage if PRODUCTION: # nocoverage
from .prod_settings import * # noqa: F403 isort: skip from .prod_settings import * # noqa: F403 isort: skip
@ -32,12 +33,9 @@ else:
with contextlib.suppress(ImportError): with contextlib.suppress(ImportError):
from zproject.custom_dev_settings import * # type: ignore[import, unused-ignore] # noqa: F403 from zproject.custom_dev_settings import * # type: ignore[import, unused-ignore] # noqa: F403
# Print that we've got settings changes, so you know if you're testing non-base code. # Track that we've got settings changes, so you know if
# # you're testing non-base code; runtornado will log.
# TODO: Figure out how to make this not be printed several CUSTOM_DEVELOPMENT_SETTINGS = True
# times, and maybe print the actual keys that are
# overridden.
print("Using custom settings from zproject/custom_dev_settings.py.")
# Do not add any code after these wildcard imports! Add it to # Do not add any code after these wildcard imports! Add it to
# computed_settings instead. # computed_settings instead.