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:]
评论列表
文章目录