MCPcopy
hub / github.com/django/django / logout_then_login

Function logout_then_login

django/contrib/auth/views.py:176–181  ·  view source on GitHub ↗

Log out the user if they are logged in. Then redirect to the login page.

(request, login_url=None)

Source from the content-addressed store, hash-verified

174
175
176def logout_then_login(request, login_url=None):
177 """
178 Log out the user if they are logged in. Then redirect to the login page.
179 """
180 login_url = resolve_url(login_url or settings.LOGIN_URL)
181 return LogoutView.as_view(next_page=login_url)(request)
182
183
184def redirect_to_login(next, login_url=None, redirect_field_name=REDIRECT_FIELD_NAME):

Calls 2

resolve_urlFunction · 0.90
as_viewMethod · 0.45