Changes between Initial Version and Version 2 of Ticket #35985


Ignore:
Timestamp:
Dec 9, 2024, 8:21:41 AM (9 days ago)
Author:
Natalia Bidart
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35985

    • Property Cc Florian Apolloner added
    • Property Resolutionwontfix
    • Property Status newclosed
    • Property Type BugCleanup/optimization
    • Property Version 5.1dev
    • Property Summary SCRIPT_NAME / FORCE_SCRIPT_NAME ignored when running reverse() on non-main threadFORCE_SCRIPT_NAME ignored when running reverse() on non-main thread
  • Ticket #35985 – Description

    initial v2  
    77The 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**.
    88
    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.
     9I'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.
    1010
    1111A simple workaround is for the user to call `set_script_prefix` by themselves:
Back to Top