code: def file(data, response, **kwargs):
      
      if not data:
          response.content_type = 'text/plain'
          return ''
  
      if hasattr(data, 'read'):
          name, data = getattr(data, 'name', ''), data
      elif os.path.isfile(data):
          name, data = data, open(data, 'rb')
      else:
          response.content_type = 'text/plain'
          response.status = HTTP_NOT_FOUND
          return 'File not found!'
  
      response.content_type = mimetypes.guess_type(name, None)[0] or 'application/octet-stream'
      return data
docs: A dynamically retrieved file