mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-05 15:27:53 +10:00
add urls log to Crawl model
This commit is contained in:
@@ -120,7 +120,8 @@ def cli(ctx, help=False):
|
||||
def main(args=None, prog_name=None):
|
||||
# show `docker run archivebox xyz` in help messages if running in docker
|
||||
IN_DOCKER = os.environ.get('IN_DOCKER', False) in ('1', 'true', 'True', 'TRUE', 'yes')
|
||||
prog_name = prog_name or ('docker compose run archivebox' if IN_DOCKER else 'archivebox')
|
||||
IS_TTY = sys.stdin.isatty()
|
||||
prog_name = prog_name or (f'docker compose run{"" if IS_TTY else " -T"} archivebox' if IN_DOCKER else 'archivebox')
|
||||
|
||||
try:
|
||||
cli(args=args, prog_name=prog_name)
|
||||
|
||||
@@ -15,9 +15,7 @@ from django.db.models import QuerySet
|
||||
from archivebox.misc.util import enforce_types, docstring
|
||||
from archivebox import CONSTANTS
|
||||
from archivebox.config.common import ARCHIVING_CONFIG
|
||||
from archivebox.config.django import setup_django
|
||||
from archivebox.config.permissions import USER, HOSTNAME
|
||||
from archivebox.misc.checks import check_data_folder
|
||||
from archivebox.parsers import PARSERS
|
||||
|
||||
|
||||
@@ -46,12 +44,8 @@ def add(urls: str | list[str],
|
||||
depth = int(depth)
|
||||
|
||||
assert depth in (0, 1), 'Depth must be 0 or 1 (depth >1 is not supported yet)'
|
||||
|
||||
# 0. setup abx, django, check_data_folder
|
||||
setup_django()
|
||||
check_data_folder()
|
||||
|
||||
# then import models once django is set up
|
||||
# import models once django is set up
|
||||
from crawls.models import Seed, Crawl
|
||||
from workers.orchestrator import Orchestrator
|
||||
from archivebox.base_models.models import get_or_create_system_user_pk
|
||||
|
||||
Reference in New Issue
Block a user