From 976f1cec7646574307f421580a2f20f0c045b598 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Fri, 9 Aug 2024 10:40:36 -0700 Subject: [PATCH] django: settings: Don't set USE_L10N on newer versions - Eliminate a Django warning message. - This setting has been deprecated. It will be remove in Django 5.0 and is always on. Tests: - On Debian stable, django.VERSION <= (4,0) evaluates to True and on testing it evaluates to False. - After the patch, the warning related to USE_L10N has disappeared. Signed-off-by: Sunil Mohan Adapa Reviewed-by: Veiko Aasa --- plinth/settings.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plinth/settings.py b/plinth/settings.py index c7320ff7b..1a982c3aa 100644 --- a/plinth/settings.py +++ b/plinth/settings.py @@ -26,6 +26,8 @@ See: https://docs.djangoproject.com/en/dev/ref/settings/ """ +import django + ALLOWED_HOSTS = ['*'] _pwd = 'django.contrib.auth.password_validation' @@ -200,7 +202,8 @@ TEMPLATES = [ TIME_ZONE = 'UTC' -USE_L10N = True +if django.VERSION <= (4, 0): + USE_L10N = True USE_TZ = True