FieldFile.delete(save=True)
[source]
Deletes the file associated with this instance and clears all attributes on the field. Note: This method will close the file if it happens to be open when delete()
is called.
The optional save
argument controls whether or not the model instance is saved after the file associated with this field has been deleted. Defaults to True
.
Note that when a model is deleted, related files are not deleted. If you need to cleanup orphaned files, you’ll need to handle it yourself (for instance, with a custom management command that can be run manually or scheduled to run periodically via e.g. cron).
Please login to continue.