Skip to main content

Store Django uploaded files as UUID files or inside UUID directories

Project description

django-uuid-upload

Library for Django that automatically stores uploaded files as mydir/{uuid}.jpg or mydir/{uuid}/original.jpg.

Installation

pip install django-uuid-upload

Usage

from django.db import models
from django_uuid_upload import upload_to_uuid

class Post(models.Model):
        # Store uploaded files as posts/{uuid}.jpg
        image = models.ImageField(upload_to=upload_to_uuid('posts'))

        # Or, store uploaded files as posts/{uuid}/original.jpg
        image = models.ImageField(upload_to=upload_to_uuid('posts', make_dir=True))

Project details


Download files

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

Files for django-uuid-upload, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size django-uuid-upload-1.0.0.tar.gz (1.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page