Skip to main content

Deletes old files.

Project description

# django-cleanup

django-cleanup automatically deletes old file for FileField, ImageField and subclasses,
and it also deletes files on models instance deletion.

**Warning! If you use transactions you may lose you files if transaction will rollback.
If you are concerned about it you need other solution for old file deletion in your project.**

Most django projects I've seen don't use transactions and this app is designed for such projects.

## How does it work?

django-cleanup connects pre_save and post_delete signals to special functions(these functions
delete old files) for each model which app is listed in INSTALLED_APPS above than 'django_cleanup'.

## Installation

pip install django-cleanup


## Configuration

Add django_cleanup to settings.py

INSTALLED_APPS = (
...
'django_cleanup', # should go after your apps
)

**django_cleanup** should be placed after all your apps. (At least after those apps which need to remove files.)

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-cleanup-0.1.10.tar.gz (2.5 kB view details)

Uploaded Source

File details

Details for the file django-cleanup-0.1.10.tar.gz.

File metadata

File hashes

Hashes for django-cleanup-0.1.10.tar.gz
Algorithm Hash digest
SHA256 7582e9eaedfa557b9c48dd3997512670c64aff733378ed1ba734c2ecc6c6ac1b
MD5 b71d380cdefd144a0473f734b4c654d0
BLAKE2b-256 7742136c5dbe15af2f1f5a2a133ef8b36b442a1fb88770f0f33e9fc5237ba3a9

See more details on using hashes here.

Supported by

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