'Display the login form for the given HttpRequest.'

@never_cache
def login(self, request, extra_context=None):

    if ((request.method == 'GET') and self.has_permission(request)):
        index_path = reverse('admin:index', current_app=self.name)
        return HttpResponseRedirect(index_path)
    from django.contrib.auth.views import LoginView
    from django.contrib.admin.forms import AdminAuthenticationForm
    context = dict(self.each_context(request), title=_('Log    in'), app_path=request.get_full_path(), username=request.user.get_username())
    if ((REDIRECT_FIELD_NAME not in request.GET) and (REDIRECT_FIELD_NAME not in request.POST)):
        context[REDIRECT_FIELD_NAME] = reverse('admin:index', current_app=self.name)
    context.update((extra_context or {}))
    defaults = {'extra_context': context, 'authentication_form': (self.login_form or AdminAuthenticationForm), 'template_name': (self.login_template or 'admin/login.html')}
    request.current_app = self.name
    return LoginView.as_view(**defaults)(request)
