def logout_then_login(request, login_url=None, current_app=None, extra_context=None):
    if not login_url:
        login_url = settings.LOGIN_URL
    login_url = resolve_url(login_url)
    return logout(request, login_url, current_app=current_app, extra_context=extra_context)
Logs out the user if he is logged in. Then redirects to the log-in page.
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/contrib/auth/views.py/logout_then_login