def handle(self, *args, **options):
        """Django command handler."""
        self.verbosity = int(options.get('verbosity'))
        self.quiet = options.get('quiet')
        try:
            connection.close()
            self.filename = options.get('input_filename')
            self.path = options.get('input_path')
            self.backup_extension = options.get('backup_extension') or 'backup'
            self.servername = options.get('servername')
            self.decrypt = options.get('decrypt')
            self.uncompress = options.get('uncompress')
            self.passphrase = options.get('passphrase')
            self.interactive = options.get('interactive')
            self.database = self._get_database(options)
            self.storage = BaseStorage.storage_factory()
            self.database = self._get_database(options)
            if 'mongo' in self.database['ENGINE']:
                self.dbcommands = MongoDBCommands(self.database)
            else:
                self.dbcommands = DBCommands(self.database)

            if not self.backup_extension:
                self.backup_extension = self.dbcommands.settings.extension or 'backup'
            if options.get('list'):
                return self._list_backups()
            self._restore_backup()
        except StorageError as err:
            raise CommandError(err)
dataset/ETHPy150Open django-dbbackup/django-dbbackup/dbbackup/management/commands/dbrestore.py/Command.handle/original