code: def login_required(request):
      "Lookup decorator to require the user to be authenticated."
      user = getattr(request, 'user', None)
      if user is None or not user.is_authenticated:
          return HttpResponse(status=401f login_required(request):
      "Lookup decorator to require the user to be authenticated."
      user = getattr(request, 'user', None)
      if user is None or not user.is_authenticated:
          return HttpResponse(status=401)
docs: Lookup decorator to require the user to be authenticated.