code: def get_fabric_tasks(self, project):
          
  
          cache_key = 'project_{}_fabfile_tasks'.format(project.pk)
          cached_result = cache.get(cache_key)
  
          if cached_result:
              return cached_result
  
          try:
              fabfile_path, activate_loc = self.get_fabfile_path(project)
  
              if activate_loc:
                  output = self.check_output(
                      'source {};fab --list --list-format=short --fabfile={}'.format(activate_loc, fabfile_path),
                      shell=True
                  )
              else:
                  output = self.check_output(
                      'fab --list --list-format=short --fabfile={}'.format(fabfile_path),
                      shell=True
                  )
  
              lines = output.splitlines()
              tasks = []
              for line in lines:
                  name = line.strip()
                  if activate_loc:
                      o = self.check_output(
                          'source {};fab --display={} --fabfile={}'.format(activate_loc, name, fabfile_path),
                          shell=True
                      )
                  else:
                      o = self.check_output(
                          ['fab', '--display={}'.format(name), '--fabfile={}'.format(fabfile_path)]
                      )
  
                  tasks.append(self.parse_task_details(name, o))
  
              cache.set(cache_key, tasks, settings.FABRIC_TASK_CACHE_TIMEOUT)
          except Exception as e:
              tasks = []
  
          return tasks
docs: Generate a list of fabric tasks that are available