code: def get_resource_url(resource):
      
      path = model_path(resource)
      parsed = list(urlparse.urlparse(path))
      parsed[1] = ""
      return urlparse.urlunparse(parsed)
docs: Returns the URL for the given resource.