From 1249c1655f40bf8a32b10ed798021d945dd856b9 Mon Sep 17 00:00:00 2001 From: Hakan Date: Fri, 10 May 2024 18:35:03 +0300 Subject: [PATCH] allow cache disablement --- CHANGES | 4 ++++ src/etools_datamart/__init__.py | 2 +- src/etools_datamart/config/settings.py | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 09410505..2679d195 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +4.5 +---- +* disable/enable cache with enviroment variable CASHE_DISABLED + 4.4 ---- * added action point filter diff --git a/src/etools_datamart/__init__.py b/src/etools_datamart/__init__.py index 458364a0..f0e307a3 100644 --- a/src/etools_datamart/__init__.py +++ b/src/etools_datamart/__init__.py @@ -1,3 +1,3 @@ NAME = "etools-datamart" -VERSION = __version__ = "4.4" +VERSION = __version__ = "4.5" __author__ = "" diff --git a/src/etools_datamart/config/settings.py b/src/etools_datamart/config/settings.py index c905f75e..3c172103 100644 --- a/src/etools_datamart/config/settings.py +++ b/src/etools_datamart/config/settings.py @@ -29,6 +29,7 @@ AZURE_STORAGE_ACCESS_MODE=(str, "r"), AZURE_STORAGE_ACCESS_TTL=(int, 60 * 60 * 24), AZURE_TENANT=(str, ""), + CACHE_DISABLED=(bool, False), 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"), @@ -227,6 +228,13 @@ "api": env.cache("CACHE_URL_API"), } +if env("CACHE_DISABLED"): + CACHES = { + "default": { + "BACKEND": "django.core.cache.backends.dummy.DummyCache", + } + } + ROOT_URLCONF = "etools_datamart.config.urls" # Python dotted path to the WSGI application used by Django's runserver.