django-orphaned
django-orphaned copied to clipboard
Skipped directories can be deleted because django_orphaned sees the parent as empty
Here's my structure:
media/
media/squarei/
media/squarei/defaults
media/squarei/defaults/example1.png
media/squarei/defaults/example2.png
media/squarei/user_upload.png
My config looks like this
ORPHANED_APPS_MEDIABASE_DIRS = {
'squarei': {
'root': MEDIA_ROOT,
'skip': (
os.path.join(MEDIA_ROOT, 'squarei/defaults'),
),
}
}
django_orphaned looks at the media/squarei
directory and decides it's empty, because no FileFields refer to it. But the skipped directory is in there, and is deleted when django_orphaned deletes media/squarei