Replacing a Django image doesn't delete original

前端 未结 8 1348
死守一世寂寞
死守一世寂寞 2020-12-13 14:43

In Django, if you have a ImageFile in a model, deleting will remove the associated file from disk as well as removing the record from the database.

Shouldn\'t replac

8条回答
  •  孤街浪徒
    2020-12-13 15:01

    If you don't use transactions or you don't afraid of loosing files on transaction rollback, you can use django-cleanup

提交回复
热议问题