mirror of
https://github.com/fergalmoran/dss.api.git
synced 2025-12-25 10:49:16 +00:00
26 lines
669 B
Python
26 lines
669 B
Python
from django.core.management.base import LabelCommand
|
|
import dropbox
|
|
from dss import settings
|
|
|
|
|
|
def _restore_database():
|
|
""" find latest database backup """
|
|
client = dropbox.client.DropboxClient(settings.DSS_DB_BACKUP_TOKEN)
|
|
|
|
|
|
class Command(LabelCommand):
|
|
help = (
|
|
"Handles restoring of items backed up"
|
|
)
|
|
missing_args_message = "Enter one of [database, settings, media, all]"
|
|
|
|
def handle_label(self, label, **options):
|
|
if label == "database":
|
|
_restore_database()
|
|
if label == "settings":
|
|
pass
|
|
if label == "media":
|
|
pass
|
|
if label == "all":
|
|
_restore_database()
|