un1t / django-cleanup

Automatically deletes old file for FileField and ImageField. It also deletes files on models instance deletion.
MIT License
1.11k stars 79 forks source link

Suggestion: Add Disclaimer that django-cleanup doesn't work with python manage.py flush #50

Closed kir12 closed 4 years ago

kir12 commented 5 years ago

So I needed a solution to periodically clear out old database entries from my database, and that database also has attached files -- something django-cleanup is well suited for. The obvious practice is to write a script using delete() and attach a crontab job to it, but I initially tried python manage.py flush (which clears out the entire database anyways) figuring that would be a quicker solution. Interestingly django-cleanup didn't catch the database records being deleted and as a result didn't delete the old files. manage.py flush isn't likely to be part of a standard production routine (which is probably why it was overlooked) but it might be a good idea to add a small disclaimer to README.md warning that manage.py flush won't work with django-cleanup. Thanks for making django-cleanup!

vinnyrose commented 5 years ago

Can you provide the version of django you were using. Are you using the out of the box manage.py file from the template, or is it modified?

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.