Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

settings: Derive RUNNING_INSIDE_TORNADO based on sys.argv.

Alex Vandiver169daa31a000
diff --git a/zerver/management/commands/runtornado.py b/zerver/management/commands/runtornado.py
index bfac27956c4..9be34a98ed4 100644
--- a/zerver/management/commands/runtornado.py
+++ b/zerver/management/commands/runtornado.py
@@ -12,7 +12,6 @@ from typing_extensions import override
from zerver.lib.management import ZulipBaseCommand
-settings.RUNNING_INSIDE_TORNADO = True
if settings.PRODUCTION:
settings.SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
diff --git a/zproject/computed_settings.py b/zproject/computed_settings.py
index 0ed6790d270..da705c11a96 100644
--- a/zproject/computed_settings.py
+++ b/zproject/computed_settings.py
@@ -295,7 +295,9 @@ if not TORNADO_PORTS:
TORNADO_PORTS = get_tornado_ports(config_file)
TORNADO_PROCESSES = len(TORNADO_PORTS)
-RUNNING_INSIDE_TORNADO = False
+RUNNING_INSIDE_TORNADO = (
+ len(sys.argv) > 1 and "manage.py" in sys.argv[0] and sys.argv[1] == "runtornado"
+)
SILENCED_SYSTEM_CHECKS = [
# auth.W004 checks that the UserProfile field named by USERNAME_FIELD has