def handle(self, *args, **options):
     cleanMedia = CleanMedia()
     # Delete empty dirs in /media/
     cleanMedia.deleteEmptyDirsRecusive()
     self.stdout.write(self.style.SUCCESS('All empty dirs in /media/ has been cleaned'))
Exemple #2
0
def clean_empty_media_dirs(sender, instance, **kwargs):
    cleanMedia = CleanMedia()
    # Delete empty dirs in /media/
    cleanMedia.deleteEmptyDirsRecusive()
Exemple #3
0
def clean_empty_media_dirs(sender, instance, **kwargs):
    cleanMedia = CleanMedia()
    # Delete imagekit chache file
    cleanMedia.cleanImagekitCacheImage(instance.main_image_thumb)
    # Delete empty dirs in /media/
    cleanMedia.deleteEmptyDirsRecusive()