Skip to main content
Release files added late

2 files were added to this release more than 14 days after its initial publication. Inspect the release files before installing.

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.

Features

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.

Features

  • Support for Django 1.3, 1.4, 1.5, 1.6 and 1.7

  • Python 3 support

  • Compatible with sorl-thumbnail and easy-thumbnail

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.)

Signals

django-cleanup sends the following signals which can be imported from django_cleanup.signals:

  • cleanup_pre_delete just before a file is deleted. Passes a file keyword argument.

  • cleanup_post_delete just after a file is deleted. Passes a file keyword argument.

Signals example for sorl.thumbnail

from django_cleanup.signals import cleanup_pre_delete, cleanup_post_delete

def sorl_delete(**kwargs):
    from sorl.thumbnail import delete
    delete(kwargs['file'])

cleanup_pre_delete.connect(sorl_delete)

How to run tests

tox

License

django-cleanup is free software under terms of the MIT License.

Copyright (C) 2012 by Ilya Shalyapin, ishalyapin@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Metadata

Release files for django-cleanup 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Files added late

2 files were uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release files before installing.

Source distribution (sdist)

Source distribution for django-cleanup 0.2.1
File Size Uploaded Provenance Actions
django-cleanup-0.2.1.tar.gz 3.6 kB Without provenance Details for django-cleanup-0.2.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for django-cleanup 0.2.1
File Interpreter ABI Platform Actions
django_cleanup-0.2.1-py3-none-any.whl Python 3 none any Details for django_cleanup-0.2.1-py3-none-any.whl
django_cleanup-0.2.1-py2-none-any.whl Python 2 none any Details for django_cleanup-0.2.1-py2-none-any.whl

Total release size: 16.5 kB

Release files / django-cleanup-0.2.1.tar.gz

Download URL django-cleanup-0.2.1.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
18b16ffe2597707d5d2e1b68c0b921a90ca16283aa79760dc1c7b2e39cdf566e
BLAKE2b-256 checksum
How to use checksums
d5290ecfe0877c83fbb7ff7e70cfea12ef770d881152c415f34275117e2a732c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_cleanup-0.2.1-py3-none-any.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL django_cleanup-0.2.1-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9ae3fb712e7f010e23191bb4ca06950d60bc4bbf641aeb6bc2c558efc061548
BLAKE2b-256 checksum
How to use checksums
e59fe325b0174849d79355779186dd77941a7ac509ba8c6538c668635a5c1438
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_cleanup-0.2.1-py2-none-any.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL django_cleanup-0.2.1-py2-none-any.whl
Size 6.4 kB
Tags Python 2
SHA-256 checksum
How to use checksums
b10d2800a81befeca000178ccc86bb18ae7e6f8ff019d478ee62f01c7c9d6f4a
BLAKE2b-256 checksum
How to use checksums
714b90ca78407b0ad50c1c60c9611dd163c2c701136ac37fd23313d7201406e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-cleanup 0.2.1

Upload timing

Release files added late

2 files were uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.


Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

3 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page