This storage backend enables having a local and a remote storage backend. It will save any file locally and queue a task to transfer it somewhere else using Celery.
If the file is accessed before it’s transferred, the local copy is returned.
pip install django-queued-storage
The QueuedStorage can be used as a drop-in replacement wherever using django.core.files.storage.Storage might otherwise be required.
This example is using django-storages for the remote backend:
from django.db import models
from queued_storage.backends import QueuedStorage
from storages.backends.s3boto import S3BotoStorage
queued_s3storage = QueuedStorage(
'django.core.files.storage.FileSystemStorage',
'storages.backends.s3boto.S3BotoStorage')
class MyModel(models.Model):
image = ImageField(storage=queued_s3storage)
| Default : | 'queued_storage' |
|---|
The cache key prefix to use when caching the storage backends.
| Default : | 5 |
|---|
How many retries should be attempted before aborting.
| Default : | 60 |
|---|
The delay between retries in seconds.
For further details see the reference documentation:
For any bug reports and feature requests, please use the Github issue tracker.