Skip to main content

Delete unused media files from Django project

Project description

Delete unused media files from Django project

This package provides management command cleanup_unused_media for Django application. With help of this command you can remove all media files which are no longer used (files without references from any model with FileField or ImageField fields or their inheritances).

Installation

  1. Install django-unused-media:

    pip install django-unused-media

    Python 2.7, 3.3, 3.4, PyPy are supported Django 1.6, 1.7, 1.8 are supported

  2. Add django-unused-media to INSTALLED_APPS:

    INSTALLED_APPS = (
        ...
        'django_unused_media',
        ...
    )

Usage

For cleanup all unused media, run:

./manage.py cleanup_unused_media

By default command runs in interactive mode. And before removing list of files will be displayed. User should confirm action. If you would like to use this command in non interactive mode, please use option --noinput:

./manage.py cleanup_unused_media --noinput

Tests

At first make sure that you are in virtualenv.

Install all dependencies:

make setup

To run tests:

make test

License

MIT licence

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-unused-media-0.1.1.tar.gz (6.2 kB view details)

Uploaded Source

File details

Details for the file django-unused-media-0.1.1.tar.gz.

File metadata

File hashes

Hashes for django-unused-media-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0bc1c155968363cbbb4fef6e33a917aeb377dc679daabbed9a3f94befc9707ff
MD5 5147be1a514ede8f77a31a2f426aafd5
BLAKE2b-256 0dde62a7de9f2ec1eda6fbd9198edb9dc07d4aabf319e912cfa37490ef7f7c33

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page