def logout_then_login(request, login_url=None, extra_context=_sentinel):
 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)

def logout_then_login ( request , login_url = None , extra_context = _sentinel ) : 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 )
logs out the user if he is logged in .