diff options
| author | Andrew Godwin <andrew@aeracode.org> | 2019-04-12 06:15:18 -0700 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-06-20 12:29:43 +0200 |
| commit | a415ce70bef6d91036b00dd2c8544aed7aeeaaed (patch) | |
| tree | 3583cef22e9b56d2ed52456ab586d9c47620bc51 /django/urls/base.py | |
| parent | cce47ff65a4dd3786c049ec14ee889e128ca7de9 (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/urls/base.py')
| -rw-r--r-- | django/urls/base.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/django/urls/base.py b/django/urls/base.py index 1200d9a25b..0e1c3d909c 100644 --- a/django/urls/base.py +++ b/django/urls/base.py @@ -1,6 +1,7 @@ -from threading import local from urllib.parse import urlsplit, urlunsplit +from asgiref.local import Local + from django.utils.encoding import iri_to_uri from django.utils.functional import lazy from django.utils.translation import override @@ -12,10 +13,10 @@ from .utils import get_callable # SCRIPT_NAME prefixes for each thread are stored here. If there's no entry for # the current thread (which is the only one we ever access), it is assumed to # be empty. -_prefixes = local() +_prefixes = Local() # Overridden URLconfs for each thread are stored here. -_urlconfs = local() +_urlconfs = Local() def resolve(path, urlconf=None): |
