feat: test middleware; use zoneinfo; fix datetime warnings

This commit is contained in:
bkfox
2023-08-23 15:08:20 +02:00
parent 02a8bb7a4e
commit 43c2d552e4
11 changed files with 53 additions and 36 deletions

View File

@ -1,7 +1,7 @@
import os
import sys
from zoneinfo import ZoneInfo
import pytz
from django.utils import timezone
sys.path.insert(1, os.path.dirname(os.path.realpath(__file__)))
@ -65,7 +65,7 @@ USE_I18N = True
USE_L10N = True
USE_TZ = True
timezone.activate(pytz.timezone(TIME_ZONE))
timezone.activate(ZoneInfo(TIME_ZONE))
try:
import locale

View File

@ -10,6 +10,7 @@ For Django settings see:
https://docs.djangoproject.com/en/3.1/topics/settings/
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from zoneinfo import ZoneInfo
from .prod import *
# FOR dev: from .dev import *
@ -20,7 +21,7 @@ LANGUAGE_CODE = "fr-BE"
LC_LOCALE = "fr_BE.UTF-8"
TIME_ZONE = "Europe/Brussels"
timezone.activate(pytz.timezone(TIME_ZONE))
timezone.activate(ZoneInfo(TIME_ZONE))
# Secret key: you MUST put a consistent secret key. You can generate one
# at https://djecrety.ir/