def logout_view(request): return auth_logout(request, template_name='registration/logout.html', extra_context=site_name(request))
def logout_view(request): return AuthLogoutView.as_view()( request, template_name='registration/logout.html', extra_context=site_name(request), )
def login_view(request, redirect_field_name=REDIRECT_FIELD_NAME, **kwargs): if request.user.is_authenticated(): redirect_to = request.GET.get(redirect_field_name, None) return safe_redirect(request, redirect_to) else: return auth_login(request, extra_context=site_name(request), **kwargs)
def login_view(request, redirect_field_name=REDIRECT_FIELD_NAME, **kwargs): if request.user.is_authenticated(): redirect_to = request.REQUEST.get(redirect_field_name, None) return safe_redirect(request, redirect_to) else: return auth_login(request, extra_context=site_name(request), **kwargs)