Django – Delete old image when update ImageField?

기존 이미지 파일을 지우고, 새로운 업데이트 된 것만 남겨두고 싶은게 인지상정

https://stackoverflow.com/questions/2878490/how-to-delete-old-image-when-update-imagefield

해결책은 아주 간단하게

Use https://github.com/un1t/django-cleanup

pip install django-cleanup

settings.py

INSTALLED_APPS = (
    ...
    'django_cleanup.apps.CleanupConfig', # should be placed after your apps

)
Share: Twitter Facebook
Bongjun Hur's Picture

About Bongjun Hur

BJ is a dev.

Seoul, Korea https://devbj.com