django-unused-media | Remove unused media files from Django project | Media library
kandi X-RAY | django-unused-media Summary
kandi X-RAY | django-unused-media Summary
Remove unused media files from Django project
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Delete unused media files
- Get a set of all media files in the media directory
- Return a set of media that are used in storage
- Returns a list of FileField objects
- Removes all empty directories
- Get all media that are not used
- Show files to delete
- Log a debug message
- Prints a message to stdout
django-unused-media Key Features
django-unused-media Examples and Code Snippets
Community Discussions
Trending Discussions on django-unused-media
QUESTION
i want to run a manage.py cmd from celery as a periodic task every x Minutes but every time i try to accomplish that as show below i get the following error:
[2019-01-17 01:36:00,006: INFO/MainProcess] Received task: Delete unused media file(s)[3dd2b93b-e32a-4736-8b24-028b9ad8da35]
[2019-01-17 01:36:00,007: WARNING/ForkPoolWorker-3] Scanning for unused media files [2019-01-17 01:36:00,008: WARNING/ForkPoolWorker-3] Unknown command: 'cleanup_unused_media --noinput --remove-empty-dirs' [2019-01-17 01:36:00,008: INFO/ForkPoolWorker-3] Task Delete unused media file(s)[3dd2b93b-e32a-4736-8b24-028b9ad8da35] succeeded in 0.0008139749998008483s: None
tasks.py
...ANSWER
Answered 2019-Jan-17 at 15:35The issue is the way you're calling call_command
. call_command
takes the name of the command as its first argument, followed by the arguments passed positionally. You're passing the whole lot as a single string. Try changing it to:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install django-unused-media
Install django-unused-media: pip install django-unused-media Python 2.7, 3.6, 3.7, pypy are tested with tox. Django 1.8, 1.9, 1.10, 1.11, 2.0, 2.1, 2.2, 3.0 are tested with tox.
Add django-unused-media to INSTALLED_APPS: INSTALLED_APPS = ( ... 'django_unused_media', ... )
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page