Skip to main content

Prune and maintain file uploads

Project description

Installation

For filesystem storage (default):

pip install django-prune-uploads

For S3 storage backends:

pip install django-prune-uploads[s3]

Then add prune_uploads to your INSTALLED_APPS.

Usage

  1. Run ./manage.py prune_uploads and have a look at the output (does not change anything in the database or the file system!)

  2. Run ./manage.py prune_uploads -v2 for a potentially much more verbose report.

  3. Run ./manage.py prune_uploads --help to learn about the available options for actually changing and/or removing files and records.

Storage Backend Support

This package supports both filesystem storage and S3-based storage backends:

Filesystem Storage

For projects using Django’s default FileSystemStorage, the command uses os.walk() to enumerate files in the MEDIA_ROOT directory.

S3 Storage

For projects using S3-based storage backends (such as django-storages with S3Boto3Storage or django-s3-storage), the command automatically detects the storage backend and uses boto3 directly to enumerate files. This is significantly faster than using Django’s storage API when dealing with buckets containing many objects.

The command will automatically detect S3 storage backends and use the appropriate enumeration method. No additional configuration is required beyond installing the s3 extra dependencies.

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_prune_uploads-0.3.1.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_prune_uploads-0.3.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file django_prune_uploads-0.3.1.tar.gz.

File metadata

  • Download URL: django_prune_uploads-0.3.1.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for django_prune_uploads-0.3.1.tar.gz
Algorithm Hash digest
SHA256 7ce0cda88179ff52c4fc71f08c8113b5f4a633b77ef715f962487e24a94f4bda
MD5 8c7011f0149e22735db233c2942fadd0
BLAKE2b-256 4df5be3510e756fbfcacc3685cd323bedc462dd1844cedca36d6ba29e35eeab3

See more details on using hashes here.

File details

Details for the file django_prune_uploads-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_prune_uploads-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 66c23107a1f297c04c571f57f6545bab7eb64f637d72f83da549e92b4fc858d2
MD5 2d410f344174d197aa328c00bb4b9c31
BLAKE2b-256 cd7672553ea6845c0abdaae66e3bf76a92bad0e1e8dfd08a3ce3c35034fdccb4

See more details on using hashes here.

Supported by

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