__init__.py 文件源码

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

项目:a4-opin 作者: liqd 项目源码 文件源码
def sanitize_next(request):
    """
    Get appropriate next value for the given request
    """
    try:
        url_name = resolve(request.path).url_name
    except Resolver404:
        url_name = '__invalid_url_name__'

    if url_name in _get_account_url_names():
        nextparam = request.GET.get('next') or request.POST.get('next')
        next = nextparam if is_safe_url(nextparam) else '/'
    else:
        next = request.get_full_path()
    return next
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号