diff --git a/scripts/setup/restore-backup b/scripts/setup/restore-backup index c2c66d7dfe..ada0357a6c 100755 --- a/scripts/setup/restore-backup +++ b/scripts/setup/restore-backup @@ -28,7 +28,7 @@ def restore_backup(tarball_file): # First, we unpack the /etc/zulip configuration, so we know how # this server is supposed to be configured (and can import - # /etc/zulip/settings.py via `from zproject import settings`, + # /etc/zulip/settings.py via `from django.conf import settings`, # next). Ignore errors if zulip-backup/settings is not present # (E.g. because this is a development backup). tarball_file.seek(0, 0) @@ -44,7 +44,8 @@ def restore_backup(tarball_file): stdin=tarball_file, ) - from zproject import settings + os.environ["DJANGO_SETTINGS_MODULE"] = "zproject.settings" + from django.conf import settings paths = [ ("settings", "/etc/zulip"), diff --git a/zerver/tests/test_docs.py b/zerver/tests/test_docs.py index 5de2d8da2f..1819fd0e25 100644 --- a/zerver/tests/test_docs.py +++ b/zerver/tests/test_docs.py @@ -4,11 +4,11 @@ import os import subprocess import ujson +from django.conf import settings from django.test import TestCase, override_settings from django.http import HttpResponse from typing import Any, Dict, List -from zproject.settings import DEPLOY_ROOT from zerver.lib.integrations import INTEGRATIONS from zerver.lib.storage import static_path from zerver.lib.test_classes import ZulipTestCase @@ -272,7 +272,7 @@ class HelpTest(ZulipTestCase): class IntegrationTest(TestCase): def test_check_if_every_integration_has_logo_that_exists(self) -> None: for integration in INTEGRATIONS.values(): - self.assertTrue(os.path.isfile(DEPLOY_ROOT + integration.logo_url), integration.name) + self.assertTrue(os.path.isfile(settings.DEPLOY_ROOT + integration.logo_url), integration.name) def test_api_url_view_subdomains_base(self) -> None: context = dict() # type: Dict[str, Any]