Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What the right setting for django-dbbackup?

Using django 1.10, django-dbbackup 3.0, postgresql-9.5.4

I'm wrote in config settings from the docs http://django-dbbackup.readthedocs.io/en/stable/installation.html, but got this error:

Traceback (most recent call last):
  File "/home/user/envs/siteEnv/lib/python3.5/site-packages/django/utils/module_loading.py", line 23, in import_string
    return getattr(module, class_name)
AttributeError: module 'dbbackup.storage' has no attribute 'filesystem_storage'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/user/envs/siteEnv/lib/python3.5/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/home/user/envs/siteEnv/lib/python3.5/site-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/user/envs/siteEnv/lib/python3.5/site-packages/django/core/management/base.py", line 305, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/user/envs/siteEnv/lib/python3.5/site-packages/django/core/management/base.py", line 356, in execute
    output = self.handle(*args, **options)
  File "/home/user/envs/siteEnv/lib/python3.5/site-packages/dbbackup/utils.py", line 99, in wrapper
    func(*args, **kwargs)
  File "/home/user/envs/siteEnv/lib/python3.5/site-packages/dbbackup/management/commands/dbbackup.py", line 49, in handle
    self.storage = get_storage()
  File "/home/user/envs/siteEnv/lib/python3.5/site-packages/dbbackup/storage.py", line 30, in get_storage
    return Storage(path, **options)
  File "/home/user/envs/siteEnv/lib/python3.5/site-packages/dbbackup/storage.py", line 66, in __init__
    self.storageCls = get_storage_class(self._storage_path)
  File "/home/user/envs/siteEnv/lib/python3.5/site-packages/django/core/files/storage.py", line 469, in get_storage_class
    return import_string(import_path or settings.DEFAULT_FILE_STORAGE)
  File "/home/user/envs/siteEnv/lib/python3.5/site-packages/django/utils/module_loading.py", line 27, in import_string
    six.reraise(ImportError, ImportError(msg), sys.exc_info()[2])
  File "/home/user/envs/siteEnv/lib/python3.5/site-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/home/user/envs/siteEnv/lib/python3.5/site-packages/django/utils/module_loading.py", line 23, in import_string
    return getattr(module, class_name)
ImportError: Module "dbbackup.storage" does not define a "filesystem_storage" attribute/class
(siteEnv)
like image 443
Dmitriy Petrov Avatar asked Aug 28 '16 11:08

Dmitriy Petrov


2 Answers

It's a bug in the documentation: https://github.com/django-dbbackup/django-dbbackup/issues/216

This seems to be the correct settings:

DBBACKUP_STORAGE = 'django.core.files.storage.FileSystemStorage'
DBBACKUP_STORAGE_OPTIONS = {'location': '/var/backups'}
like image 133
publysher Avatar answered Oct 05 '22 06:10

publysher


It's an old documentation by your link, try to look here or use previous version (2.5.x) of app.

like image 26
Sergei Zherevchuk Avatar answered Oct 05 '22 05:10

Sergei Zherevchuk