From 35a5700c7323175434cb2bc82b4e764210c272aa Mon Sep 17 00:00:00 2001 From: Cristian Date: Mon, 7 Dec 2020 16:42:16 -0500 Subject: [PATCH] fix: Move the setup_django command to a place where we already know what the actual subcommand is --- archivebox/cli/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/archivebox/cli/__init__.py b/archivebox/cli/__init__.py index c48cb06d..dfc607e1 100644 --- a/archivebox/cli/__init__.py +++ b/archivebox/cli/__init__.py @@ -58,6 +58,8 @@ def run_subcommand(subcommand: str, stdin: Optional[IO]=None, pwd: Union[Path, str, None]=None) -> None: """Run a given ArchiveBox subcommand with the given list of args""" + from ..config import setup_django + setup_django() module = import_module('.archivebox_{}'.format(subcommand), __package__) module.main(args=subcommand_args, stdin=stdin, pwd=pwd) # type: ignore @@ -136,5 +138,3 @@ __all__ = ( ) -from ..config import setup_django -setup_django()