Add a script to remove unused media

This commit is contained in:
Jean-Marie Favreau 2025-03-01 12:52:58 +01:00
parent a89cc6e856
commit 945db0d967
3 changed files with 6 additions and 0 deletions

View File

@ -59,6 +59,10 @@ create-reference-locations:
docker exec -it $(BACKEND_APP_NAME) $(SHELL) "-c" \ docker exec -it $(BACKEND_APP_NAME) $(SHELL) "-c" \
"python3 manage.py runscript create_reference_locations" "python3 manage.py runscript create_reference_locations"
cleanup-unused-media:
docker exec -it $(BACKEND_APP_NAME) $(SHELL) "-c" \
"python3 manage.py cleanup_unused_media"
build-dev: build-dev:
DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f docker-compose.yml up --build -d DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f docker-compose.yml up --build -d

View File

@ -64,6 +64,7 @@ INSTALLED_APPS = [
"honeypot", "honeypot",
"template_profiler_panel", "template_profiler_panel",
'django_cleanup.apps.CleanupConfig', 'django_cleanup.apps.CleanupConfig',
'django_unused_media',
] ]
HONEYPOT_FIELD_NAME = "alias_name" HONEYPOT_FIELD_NAME = "alias_name"

View File

@ -48,3 +48,4 @@ django-autoslug==1.9.9
django-debug-toolbar-template-profiler==2.1.0 django-debug-toolbar-template-profiler==2.1.0
requests==2.32.3 requests==2.32.3
django-cleanup==9.0.0 django-cleanup==9.0.0
django-unused-media==0.2.2