@sensitive_post_parameters()<EOL>@csrf_protect<EOL>@never_cache<EOL>def login(request, template_name='<STR_LIT>',<EOL>redirect_field_name=REDIRECT_FIELD_NAME,<EOL>authentication_form=forms.AuthenticationForm,<EOL>current_app=None, extra_context=None):
redirect_to = request.POST.get(redirect_field_name,<EOL>request.GET.get(redirect_field_name, '<STR_LIT>'))<EOL>if request.method == "<STR_LIT:POST>":<EOL><INDENT>form = authentication_form(request, data=request.POST)<EOL>if form.is_valid():<EOL><INDENT>if not is_safe_url(url=redirect_to, host=request.get_host()):<EOL><INDENT>redirect_to = resolve_url(settings.LOGIN_REDIRECT_URL)<EOL><DEDENT>if not form.cleaned_data['<STR_LIT>']:<EOL><INDENT>request.session.set_expiry(<NUM_LIT:0>)<EOL><DEDENT>auth_login(request, form.get_user())<EOL>return HttpResponseRedirect(redirect_to)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>form = authentication_form(request)<EOL><DEDENT>current_site = get_current_site(request)<EOL>context = {<EOL>'<STR_LIT>': form,<EOL>redirect_field_name: redirect_to,<EOL>'<STR_LIT>': current_site,<EOL>'<STR_LIT>': current_site.name,<EOL>}<EOL>if extra_context is not None:<EOL><INDENT>context.update(extra_context)<EOL><DEDENT>if current_app is not None:<EOL><INDENT>request.current_app = current_app<EOL><DEDENT>return TemplateResponse(request, template_name, context)<EOL>
Displays the login form and handles the login action.

    Copy from Django source code, added abilithy to set remember_me