Skip to content

Commit cb23ee7

Browse files
committed
#16 dont use pytz
1 parent a2fb755 commit cb23ee7

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

django_auto_logout/utils.py

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
from datetime import datetime, timedelta
22
from typing import Union
3-
from django.conf import settings
43
from django.http import HttpRequest
5-
from pytz import timezone
4+
from django.utils.timezone import now
65

7-
8-
def now() -> datetime:
9-
"""
10-
Returns the current time with the Django project timezone.
11-
:return: datetime
12-
"""
13-
if settings.USE_TZ:
14-
return datetime.now(tz=timezone(settings.TIME_ZONE))
15-
return datetime.now()
6+
now = now
167

178

189
def seconds_until_session_end(

0 commit comments

Comments
 (0)