Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Multi-Database configuration #306

Open
abaruchi opened this issue Dec 7, 2023 · 0 comments
Open

Support Multi-Database configuration #306

abaruchi opened this issue Dec 7, 2023 · 0 comments

Comments

@abaruchi
Copy link

abaruchi commented Dec 7, 2023

Currently, Django-Watson only supports a configuration with a single database. When running the command python manage.py buildwatson, if a default database isn't configured, you get an error:

Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    main()
  File "manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 425, in execute_from_command_line
    utility.execute()
  File "venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 419, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "venv/lib/python3.10/site-packages/django/core/management/base.py", line 373, in run_from_argv
    self.execute(*args, **cmd_options)
  File "venv/lib/python3.10/site-packages/django/core/management/base.py", line 417, in execute
    output = self.handle(*args, **options)
  File "venv/lib/python3.10/site-packages/watson/management/commands/buildwatson.py", line 187, in handle
    refreshed_model_count += rebuild_index_for_model(
  File "venv/lib/python3.10/site-packages/watson/management/commands/buildwatson.py", line 72, in rebuild_index_for_model
    with transaction.atomic():
  File "venv/lib/python3.10/site-packages/django/db/transaction.py", line 189, in __enter__
    if not connection.get_autocommit():
  File "venv/lib/python3.10/site-packages/django/db/backends/base/base.py", line 400, in get_autocommit
    self.ensure_connection()
  File "venv/lib/python3.10/site-packages/django/db/backends/dummy/base.py", line 20, in complain
    raise ImproperlyConfigured("settings.DATABASES is improperly configured. "
django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.

Django-Watson should add an option to indicate which database the command suppose to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant