
To launch the test suite: $ python manage.py test NOTE: if you're testing this package as stand-alone, you can set the access token in a local_settings.py module put in the root folder. In order to run them, you need to set DROPBOX_ACCESS_TOKEN properly. Tests are written following Django's best practices. You can also set default root folder setting the value of DROPBOX_ROOT_FOLDER: DROPBOX_ROOT_FOLDER = '/Public'īy default it's set to '/' (root folder). If you have your Dropbox App key and App secret, you can set DROPBOX_CONSUMER_KEY and DROPBOX_CONSUMER_SECRET settings in settings.py, then run: $ python manage.py get_dropbox_token Īnd follow up on screen instructions, finally set the DROPBOX_ACCESS_TOKEN_SECRET in your settings.py module. If you don't have DROPBOX_ACCESS_TOKEN you can create one after creating a Dropbox app at Dropbox for Developers. In order to let it work properly, you must set the next settings: DROPBOX_ACCESS_TOKEN = 'xxx' Photo = models.ImageField(upload_to='photos', storage=DROPBOX_STORAGE. If you just want to use it on a single model field, you can simply import it: from django_dropbox_storage.storage import DropboxStorage If you want to use django_dropbox_storage as default storage for all file uploads, you need to adjust DEFAULT_FILE_STORAGE too: DEFAULT_FILE_STORAGE = 'django_dropbox_' Then open the settings.py of your project and include it to your INSTALLED_APPS: INSTALLED_APPS = ( Installingįirst things first: $ pip install django-dropbox-storage How does this work? For iOS users, clicking on a shared link will give you the option to “Open in app.” Android users can choose to always directly open files within the Dropbox app.A Dropbox Storage for your Django apps Whatĭjango-dropbox-storage allows Django apps to use Dropbox as a storage backend for file uploading. And if it’s a Microsoft Office file like an Excel spreadsheet or Word document, you can edit the file right from the Office apps on your device.


If the file was already saved to your Dropbox, we’ll take you right to it in the app so you can do more with it - like move the file, rename it, or favorite it for offline access. Starting today, when you click on a Dropbox shared link from your mobile device, you can open the file or folder right in the Dropbox app - which means you get rich previews for documents and photos and an easy way to save the file or folder to your Dropbox account. But taking advantage of that magic starts with viewing and saving your files in Dropbox, so we’ve been working on making that process even easier, wherever you use Dropbox. When your files are in Dropbox, they become a little more magical - they’re easier to view, edit, and share, and they’re with you wherever you are.
