Changes between Initial Version and Version 2 of Ticket #35985
- Timestamp:
- Dec 9, 2024, 8:21:41 AM (9 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #35985
- Property Cc added
- Property Resolution → wontfix
- Property Status new → closed
- Property Type Bug → Cleanup/optimization
- Property Version 5.1 → dev
- Property Summary SCRIPT_NAME / FORCE_SCRIPT_NAME ignored when running reverse() on non-main thread → FORCE_SCRIPT_NAME ignored when running reverse() on non-main thread
-
Ticket #35985 – Description
initial v2 7 7 The management command generates URLs that include the prefix as expected if the code runs on main thread. But if the management command spawns a thread, the code running on thread **generates URLs without the prefix**. 8 8 9 I'm not sure but I think this is related to ` hc.urls.base._prefix` being a `Local` object. I'm guessing it, as the name suggests, does not share data between threads. Even though `set_script_prefix` is called on main thread, the other threads do not see it.9 I'm not sure but I think this is related to `django.urls.base._prefixes` being a `Local` object. I'm guessing it, as the name suggests, does not share data between threads. Even though `set_script_prefix` is called on main thread, the other threads do not see it. 10 10 11 11 A simple workaround is for the user to call `set_script_prefix` by themselves: