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))
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-uuid-upload-1.0.0.tar.gz.
File metadata
- Download URL: django-uuid-upload-1.0.0.tar.gz
- Upload date:
- Size: 1.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
Python-urllib/2.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c62fd45bbff90e0f4444f8ff0b5fafb4b51d725f26d5ff749263db33f04934e
|
|
| MD5 |
4f13bcac8b8f4ea5fe209e51989dcc91
|
|
| BLAKE2b-256 |
6976e65b50e15b4f96215ad67bf4e3d63afc6bbe2fb8a21b8902163e60169405
|