From 5a2dea6989d39dbba14b684e637c04be577000c5 Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Sun, 24 Nov 2024 11:55:37 +0100 Subject: [PATCH] =?UTF-8?q?On=20reg=C3=A9n=C3=A8re=20le=20cache=20du=20css?= =?UTF-8?q?=20qu'une=20seule=20fois=20par=20jour?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/agenda_culturel/settings/base.py | 3 ++- src/agenda_culturel/templatetags/cat_extra.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/agenda_culturel/settings/base.py b/src/agenda_culturel/settings/base.py index 9f12fd8..9df688b 100644 --- a/src/agenda_culturel/settings/base.py +++ b/src/agenda_culturel/settings/base.py @@ -14,7 +14,8 @@ APP_ENV = os_getenv("APP_ENV", "dev") DEBUG = os_getenv("DEBUG", "true").lower() in ["True", "true", "1", "yes", "y"] ALLOWED_HOSTS = os_getenv("ALLOWED_HOSTS", "localhost").split(",") - +if DEBUG: + ALLOWED_HOSTS = ALLOWED_HOSTS + ['testserver'] if DEBUG: CSRF_TRUSTED_ORIGINS = os_getenv("CSRF_TRUSTED_ORIGINS", "http://localhost").split( diff --git a/src/agenda_culturel/templatetags/cat_extra.py b/src/agenda_culturel/templatetags/cat_extra.py index b9b3e4c..a73e5ad 100644 --- a/src/agenda_culturel/templatetags/cat_extra.py +++ b/src/agenda_culturel/templatetags/cat_extra.py @@ -123,7 +123,7 @@ def css_categories(): result += "}" result += "" - cache.set('css_categories', result, 3600) # 1 hour + cache.set('css_categories', result, 86400) # 1 day return mark_safe(result)