We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a2fb755 commit cb23ee7Copy full SHA for cb23ee7
django_auto_logout/utils.py
@@ -1,18 +1,9 @@
1
from datetime import datetime, timedelta
2
from typing import Union
3
-from django.conf import settings
4
from django.http import HttpRequest
5
-from pytz import timezone
+from django.utils.timezone import now
6
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()
+now = now
16
17
18
def seconds_until_session_end(
0 commit comments