utils.py 文件源码

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

项目:pyconjp-website 作者: pyconjp 项目源码 文件源码
def strip_script_prefix(url):
    """
    Strips the SCRIPT_PREFIX from the URL. Because this function is meant for
    use in templates, it assumes the URL starts with the prefix.
    """
    assert url.startswith(urlresolvers.get_script_prefix()), \
            "URL must start with SCRIPT_PREFIX: %s" % url
    pos = len(urlresolvers.get_script_prefix()) - 1
    return url[:pos], url[pos:]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号