code: def api_auth(func):
      
      @wraps(func)
      def _decorator(request, *args, **kwargs):
          authentication = APIAuthentication(request)
          if authentication.authenticate():
              return func(request, *args, **kwargs)
          raise Http404
      return _decorator
docs: If the user is not logged in, this decorator looks for basic HTTP auth
      data in the request header.