Returns the URL for the given resource.

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