views.py 文件源码

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

项目:Scrum 作者: prakharchoudhary 项目源码 文件源码
def logout_then_login(request, login_url=None, extra_context=_sentinel):
    """
    Logs out the user if they are logged in. Then redirects to the log-in page.
    """
    if extra_context is not _sentinel:
        warnings.warn(
            "The unused `extra_context` parameter to `logout_then_login` "
            "is deprecated.", RemovedInDjango21Warning
        )

    if not login_url:
        login_url = settings.LOGIN_URL
    login_url = resolve_url(login_url)
    return LogoutView.as_view(next_page=login_url)(request)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号