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.)
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
Release history Release notifications | RSS feed
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.9.tar.gz
(2.5 kB
view details)
File details
Details for the file django-cleanup-0.1.9.tar.gz
.
File metadata
- Download URL: django-cleanup-0.1.9.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 934618c4416a3fc44c47446bc4bd5ad41d5c49760443335b2bd0e910b69a0d64 |
|
MD5 | cfe2d78428f0af5871d74a96722f8bd5 |
|
BLAKE2b-256 | 64dbd22008580e1208c80dec377651f5fcc9a65088b041b653316d30a3b5939f |