DBBackup to Dropbox¶
In order to backup to Dropbox, you'll first need to create a Dropbox Account and set it up to communicate with the Django-DBBackup application. Don't worry, all instructions are below.
Setup Your Dropbox Account¶
- Login to Dropbox and navigate to Developers » MyApps.
- Click the button to create a new app and name it whatever you like. For reference, I named mine 'Website Backups'.
- After your app is created, note the options button and more importantly the 'App Key' and 'App Secret' values inside. You'll need those later.
Setup Your Django Project¶
- Install django-dbbackup and the required Python
Dropbox Client API.
If using Pip, you can install this package using the following command:
>> cd django-dbbackup >> python setup.py install >> pip install hg+https://bitbucket.org/dropboxapi/dropbox-client-python
- Add 'dbbackup' to INSTALLED_APPS in your settings.py file.
- Include the required settings below.
DBBACKUP_STORAGE = 'dbbackup.storage.dropbox_storage' DBBACKUP_TOKENS_FILEPATH = '<local_tokens_filepath>' DBBACKUP_DROPBOX_APP_KEY = '<dropbox_app_key>' DBBACKUP_DROPBOX_APP_SECRET = '<dropbox_app_secret>'
- Now you're ready to use the backup management commands. The first time you run a command you'll be prompted to visit a Dropbox URL to allow DBBackup access to your Dropbox account.
Available Settings¶
DBBACKUP_TOKENS_FILEPATH (required)
The local filepath to store the Dropbox oAuth
request and tokens. This file will be auto-created, but should be treated like any other
password to access your website. NOTE: Do not share these keys with anyone you do not trust with access to your
Dropbox files.
DBBACKUP_DROPBOX_APP_KEY (required)
String containing your Dropbox App Key. NOTE: Do not share these keys with anyone
you do not trust with access to your Dropbox files.
DBBACKUP_DROPBOX_APP_SECRET (required)
String containing your Dropbox App Secret. NOTE: Do not share these keys with anyone
you do not trust with access to your Dropbox files.
DBBACKUP_DROPBOX_ACCESS_TYPE (optional)
String containing your Dropbox Access Type. This is
either 'dropbox' or 'app_folder' depending on the access type specified when creating your application on
the Dropbox website. This defaults to 'dropbox', assuming your application has full access to your
Dropbox folder.
DBBACKUP_DROPBOX_DIRECTORY (optional)
The directory in Dropbox you wish to save
your backups. By default this is set to '/django-dbbackups/'.
About This Project
Django-DBBackup is a project created by me (Michael Shepanski), a web developer located in Boston, MA. I developed this project out of a need to backup this personal site database to an offsite location. Feel free to manipulate, improve upon, and use however you'd like.
Licensed via Creative Commons Attribution.
More Documentation
- Introduction & Management Commands
- Setup Backups to Amazon S3
- Setup Backups to Dropbox
- Setup Backups to Local Disk
- Customize Backup Commands
Database Compatability
My testing resulted the following. If you find different, please let me know and I will adjust.
- SQLite 3.x
- MySQL 5.x
- PostgreSQL 9.x
Support & Contact
- Fork me from the Bitbucket repository.
- Join discussions in the Google Group.
- Report issues and bugs here.
- Follow @PKKid on Twitter for release updates and news.