Skip to main content

A simple wrapper for Rclone as a Django storage

Project description

Django Rclone Storage

A simple wrapper for Rclone as a Django storage.

Usage

First, add these settings to your Django settings:

# The remote name in your rclone.conf
RCLONE_REMOTE = 'onedrive'
# Remote path where all the files will be uploaded. Default: /
RCLONE_REMOTE_ROOT = '/'
# Local path where your rclone.conf locates. If it's not set, rclone should use the default .conf file.
RCLONE_CONFIG_PATH = '/path/to/config'

And, set the default storage:

DEFAULT_FILE_STORAGE = 'rclonestorage.rclone_remote.RcloneRemoteStorage'

Or, you can just pass the settings to a RcloneRemoteStorage object and use it in the FileField:

file = models.FileField(
    storage=RcloneRemoteStorage(remote='remote',
                                root_path='/',
                                config_path='/path/to/config')
)

Reference

django-storages

python-rclone

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-rclone-storage-0.1.1.tar.gz (6.9 kB view hashes)

Uploaded Source

Built Distribution

django_rclone_storage-0.1.1-py3-none-any.whl (6.1 kB view hashes)

Uploaded Python 3

Supported by

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