urls.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:sdining 作者: Lurance 项目源码 文件源码
def remove_query_param(url, key):
    """
    Given a URL and a key/val pair, remove an item in the query
    parameters of the URL, and return the new URL.
    """
    (scheme, netloc, path, query, fragment) = urlparse.urlsplit(url)
    query_dict = urlparse.parse_qs(query, keep_blank_values=True)
    query_dict.pop(key, None)
    query = urlparse.urlencode(sorted(list(query_dict.items())), doseq=True)
    return urlparse.urlunsplit((scheme, netloc, path, query, fragment))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号