Why are files being deleted with their model? (solved)

EDIT: found the culprit – we had this in our requirements: django-cleanup==4.0.0

I have a model, Document, with a FileField, file. I can upload a file into the filefield and everything works as expected. But if I delete a Document instance from the database, the file is deleted along with it.

This causes problems if something else happens to be using that file. Now, my first instinct is to look for a Django setting to not delete files by default, but I can’t find any such setting. In fact – and this is the bizarre thing that brought me here – every article I can find about Django file deletion describes the opposite problem. That is, people want their files to be deleted automatically, but Django doesn’t do that without modification. (This article, for example, is particularly vexing, since it specifically says Django doesn’t do the thing it’s doing, due to the exact problems we are having.)

So, two-part question:

  1. Why is our instance of Django not behaving the way the docs say it should?
  2. How do I make it stop?

(Using Django 3.1.4 with Python 3.7.6)

The Document model:

class Document(BaseModel):
    """
    A table to hold any random documents that don't belong in static.
    Define a unique key for each place any of these documents are used.
    """
    FILE_UPLOAD_PATH = 'downloads/'

    FORMS_KEY = 'WEBFORMS'
    MARKETING_KEY = 'MKTG'
    BANNER_KEY = 'BANNERS'
    KEYS = [
        (FORMS_KEY, 'Forms & Applications page'),  # the PDFs on /forms/
        (MARKETING_KEY, 'Marketing'),
        (BANNER_KEY, 'Banners'),  # pdfs linked to from banners on home page
    ]

    key = models.CharField(max_length=10, choices=KEYS)
    name = models.CharField(max_length=100)
    file = models.FileField(max_length=255, upload_to=FILE_UPLOAD_PATH)
    active = models.BooleanField(default=True)

    def __str__(self):
        return f'{self.name}'

And for completeness, the BaseModel it extends:

class BaseModel(models.Model):
    last_updated_on = models.DateTimeField(auto_now=True)

    # while auto_add_now would be suitable here, setting a default allows us to import created_on data from the old database
    created_on = models.DateTimeField(default=timezone.now, editable=False)

    class Meta:
        abstract = True
        ordering = ['last_updated_on']

Thanks for reading!