Skip to content

ElnathMojo/django-rclone-storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A simple Django storage wrapper for Rclone.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages