Comment 3 for bug 1363105

Revision history for this message
Blake Rouse (blake-rouse) wrote :

The issue is that

get_script_prefix() returns '/MAAS/' when running in a django thread.

get_script_prefix() returns '/' when running in an other thread, this breaks the result that reverse returns.

try it:

import threading
from django.core.urlresolvers import get_script_prefix

print(get_script_prefix())
def thread_print():
     print(get_script_prefix())
t = threading.Thread(target=thread_print)
t.start()
t.join()

how to make get_script_prefix to return the correct value in a thread, is unknown to me.