From b5b4fb74588675b1c51065dd99ffd93fc370952f Mon Sep 17 00:00:00 2001 From: Hakan Date: Fri, 10 May 2024 19:25:04 +0300 Subject: [PATCH] allow flexible cache setup --- src/etools_datamart/config/settings.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/etools_datamart/config/settings.py b/src/etools_datamart/config/settings.py index 3c172103..3e8df820 100644 --- a/src/etools_datamart/config/settings.py +++ b/src/etools_datamart/config/settings.py @@ -30,6 +30,7 @@ AZURE_STORAGE_ACCESS_TTL=(int, 60 * 60 * 24), AZURE_TENANT=(str, ""), CACHE_DISABLED=(bool, False), + CACHES=(str, ""), CACHE_URL=(str, "redis://127.0.0.1:6379/1"), CACHE_URL_API=(str, "redis://127.0.0.1:6379/2?key_prefix=api"), CACHE_URL_LOCK=(str, "redis://127.0.0.1:6379/2?key_prefix=lock"), @@ -234,6 +235,9 @@ "BACKEND": "django.core.cache.backends.dummy.DummyCache", } } +elif len(env("CACHES")) > 8: + CACHES = env("CACHES") + ROOT_URLCONF = "etools_datamart.config.urls"