﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35807	Clarify django.urls.set_urlconf scoping behaviour	Enrico Zini	Carlton Gibson	"`django.urls.set_urlconf` [https://github.com/django/django/blob/main/django/urls/base.py#L128 docstring] mentions setting the urlconf for the current thread. However, this is backed by `asgiref.local.Local`, which is supposed to provide scoping features related to asyncio tasks as well. This becomes relevant, for example, when doing multi-tenancy with more than one urlconf and trying to call `django.urls.reverse` in an ASGI application.

I have been trying to infer what is the expected behaviour in async Django code by following the current implementation, and I found that `asgiref.local.Local` behaviour has changed over time (see https://github.com/django/asgiref/issues/473).

I assume that using `asgiref.local.Local` instead of `threading.local` hints at an intention is to give `set_urlconf`/`get_urlconf` meaningful semantics for Channels consumers or ASGI applications.

Whether the intention is to isolate `set_urlconf`/`get_urlconf` across different asyncio tasks or to only support isolation between threads, I suppose it would be useful if their behaviour was documented also for the case of asyncio code, especially given they back `django.urls.reverse`."	Cleanup/optimization	closed	Documentation	5.0	Normal	fixed		Andrew Godwin Carlton Gibson	Ready for checkin	1	0	0	0	0	0
