def login(self, request, extra_context=None):
redirect_to = request.POST.get(REDIRECT_FIELD_NAME, request.GET.get(REDIRECT_FIELD_NAME))<EOL>if not redirect_to or not is_safe_url(url=redirect_to, allowed_hosts=[request.get_host()]):<EOL><INDENT>redirect_to = resolve_url(settings.LOGIN_REDIRECT_URL)<EOL><DEDENT>return redirect_to_login(redirect_to)<EOL>
Redirects to the site login page for the given HttpRequest.