{"categories":[{"label":"Utilities","url":"https://skillfed.io/packages/category/utilities/5"}],"enrichment":{"capability":"Automatically deletes old files when Django FileField and ImageField values change or models are deleted, eliminating orphaned files from storage.","skillfed_tags":["django-app","file-management","signal-based"],"use_cases":["Remove old product images when updating an e-commerce catalog without leaving orphaned files on disk.","Clean up user profile pictures when accounts are deleted or users upload new avatars.","Prevent storage bloat in document management systems when old versions are replaced.","Integrate with thumbnail libraries to delete generated thumbnails alongside original images.","Ensure file consistency in multi-tenant applications where model deletions must not leave dangling file references."],"what_it_does":"django-cleanup is a Django app that automatically manages file cleanup for FileField and ImageField instances. It hooks into Django's model signals (post_init, pre_save, post_save, post_delete) to track when files are replaced or models are deleted, then schedules file deletion within the current transaction. This prevents orphaned files from accumulating on disk when you update or remove model instances.\n\nThe package works transparently once installed\u2014you add it to INSTALLED_APPS (at the bottom to avoid signal handler conflicts) and it discovers all FileField instances in your models. It maintains a local cache of original field values to detect changes, and integrates with Django's transaction system to ensure deletions happen safely. It includes advanced features like pre/post-delete signals for integrating with thumbnail libraries, a refresh method for cache management, and decorators to selectively ignore or include specific models.","worth_installing":"Yes. django-cleanup solves a common Django problem (orphaned files) with zero configuration beyond adding it to INSTALLED_APPS. No runtime dependencies, permissive license, and a stable codebase with 1213 GitHub stars make it a low-risk addition. The aging maintenance status is not a concern given the package's narrow, well-defined scope and recent commit activity. Install it unless your project uses a non-transactional database or shares files across multiple model instances (both documented limitations)."},"id":"django-cleanup","links":{"html":"https://skillfed.io/packages/django-cleanup","md":"https://skillfed.io/packages/django-cleanup.md","pypi":"https://pypi.org/project/django-cleanup/"},"maintenance":{"status":"aging"},"meta":{"latest_release":"2024-09-18","license_spdx":null,"license_treatment":"permissive","name":"django-cleanup","python_support":"supports_current","summary":"Deletes old files."},"popularity":{"monthly_downloads":702420,"position":5284,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"9.0.0"}
