Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Dropbox as Django media files storage?

Is there a clean way of using Dropbox as storage for django media files?. Like you would do with s3boto and AmazonS3 described here: How to set-up a Django project with django-storages and Amazon S3

Thanks

like image 642
leferreyra Avatar asked Jun 30 '13 03:06

leferreyra


People also ask

Does Django use Dropbox?

A Django files storage using Dropbox as a backend via the official Dropbox SDK for Python. Currently only v2 of the API is supported.

What is default storage in Django?

By default, Django stores files locally, using the MEDIA_ROOT and MEDIA_URL settings. The examples below assume that you're using these defaults. However, Django provides ways to write custom file storage systems that allow you to completely customize where and how Django stores files.

What is Django storage?

django-storages is a project to provide a variety of storage backends in a single library. This library is usually compatible with the currently supported versions of Django. Check the Trove classifiers in setup.py to be sure. django-storages is backed in part by Tidelift.


1 Answers

django-storages has a dropbox implementation ready to go, just

pip install dropbox django-storages

and in your settings file:

INSTALLED_APPS += ( 'storages', )

DEFAULT_FILE_STORAGE = 'storages.backends.dropbox.DropBoxStorage'

From: http://django-storages.readthedocs.io/en/latest/backends/dropbox.html

like image 93
iepathos Avatar answered Sep 21 '22 03:09

iepathos