code: def build_absolute_uri(request, relative_url):
      
      webroot = getattr(settings, 'WEBROOT', '')
      if webroot.endswith("/") and relative_url.startswith("/"):
          webroot = webroot[:-1]
  
      return request.build_absolute_uri(webroot + relative_url)
docs: Ensure absolute_uri are relative to WEBROOT.