From d1a336986a30b151c0356f50b06aecb79492c795 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Fri, 4 Aug 2023 14:06:30 -0500 Subject: [PATCH] v2 flag --- server/settings.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/settings.py b/server/settings.py index f3285f9d..4433ab5c 100644 --- a/server/settings.py +++ b/server/settings.py @@ -29,6 +29,9 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = os.environ.get("OPEN5E_DEBUG", "") != "False" +# A flag that is True when not production to disallow /v2 api endpoint in production. +V2_ENABLED = os.environ.get("SERVER_NAME", "") != "api.open5e.com" + # Added as part of the migration from django 2 to django 3. # Not likely to apply in the short term. https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"