Add support for Django 5 (#120)

This commit is contained in:
Stan Triepels
2023-10-12 22:44:19 +02:00
committed by GitHub
parent 54ab399758
commit 1d2a6059db
8 changed files with 962 additions and 856 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ def get_func_repr(func):
def localtime(value=None) -> datetime:
"""Override for timezone.localtime to deal with naive times and local times"""
if settings.USE_TZ:
if django.VERSION >= (4, 0) and settings.USE_DEPRECATED_PYTZ:
if django.VERSION >= (4, 0) and getattr(settings, "USE_DEPRECATED_PYTZ", False):
import pytz
convert_to_tz = pytz.timezone(Conf.TIME_ZONE)