Skip to content

ImportError is raised when running from command line #432

Open
@VBobCat

Description

@VBobCat

Bug Report

Describe the bug

ImportError is raised when running python manage.py dbbackup from command line

To Reproduce

  1. install with pip install django-dbbackup
  2. add app 'dbbackup' to INSTALLED_APPS list in settings.py
  3. add DBBACKUP_STORAGE and DBBACKUP_STORAGE_OPTIONS vars to settings.py as per docs setting the latter to an existing path in filesystem
  4. run python manage.py dbbackup from command line

Expected behavior

Backup file to be created at appointed folder

Screenshots or reproduction

C:\...>python manage.py dbbackup

Traceback (most recent call last):
  File "C:\...\manage.py", line 22, in <module>
    main()
  File "C:\...\manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "C:\...\venv\lib\site-packages\django\core\management\__init__.py", line 446, in execute_from_command_line
    utility.execute()
  File "C:\...\venv\lib\site-packages\django\core\management\__init__.py", line 420, in execute
    django.setup()
  File "C:\...\venv\lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\...\venv\lib\site-packages\django\apps\registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "C:\...\venv\lib\site-packages\django\apps\config.py", line 126, in create
    mod = import_module(mod_path)
  File "C:\Program Files\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\...\venv\lib\site-packages\dbbackup\apps.py", line 3, in <module>
    from django.utils.translation import ugettext_lazy as _
ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation' (C:\...\venv\lib\site-packages\django\utils\translation\__init__.py)

Versions

Django-dbbackup

  • pypi: 3.3.0

External tools

  • Python: 3.10.3
  • Django: 4.0.3
  • OS: Windows 10 64bit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions