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 <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Sunil Mohan Adapa 2024-08-09 10:40:36 -07:00 committed by Veiko Aasa
parent 96cbd0ef7f
commit 976f1cec76
No known key found for this signature in database
GPG Key ID: 478539CAE680674E

View File

@ -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