summaryrefslogtreecommitdiff
path: root/django/utils/timezone.py
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2019-04-12 06:15:18 -0700
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-06-20 12:29:43 +0200
commita415ce70bef6d91036b00dd2c8544aed7aeeaaed (patch)
tree3583cef22e9b56d2ed52456ab586d9c47620bc51 /django/utils/timezone.py
parentcce47ff65a4dd3786c049ec14ee889e128ca7de9 (diff)
Fixed #30451 -- Added ASGI handler and coroutine-safety.
This adds an ASGI handler, asgi.py file for the default project layout, a few async utilities and adds async-safety to many parts of Django.
Diffstat (limited to 'django/utils/timezone.py')
-rw-r--r--django/utils/timezone.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/utils/timezone.py b/django/utils/timezone.py
index 58e92c1fa8..4c43377447 100644
--- a/django/utils/timezone.py
+++ b/django/utils/timezone.py
@@ -6,9 +6,9 @@ import functools
import warnings
from contextlib import ContextDecorator
from datetime import datetime, timedelta, timezone, tzinfo
-from threading import local
import pytz
+from asgiref.local import Local
from django.conf import settings
from django.utils.deprecation import RemovedInDjango31Warning
@@ -89,7 +89,7 @@ def get_default_timezone_name():
return _get_timezone_name(get_default_timezone())
-_active = local()
+_active = Local()
def get_current_timezone():