code: def auto_delete_files_on_instance_delete(instance: Any,
                                           fieldnames: Iterable[str]) -> None:
      
      for fieldname in fieldnames:
          filefield = getattr(instance, fieldname, None)
          if filefield:
              if os.path.isfile(filefield.path):
                  os.remove(filefield.path)
docs: Deletes files from filesystem when object is deleted.