diff --git a/.env b/.env new file mode 100644 index 0000000..e69de29 diff --git a/Dockerfile b/Dockerfile index c495aea..bd25c33 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && rm -rf /var/lib/apt/lists/* COPY requirements.txt . -RUN pip install --no-cache-dir -r requirements.txt +RUN pip install --no-cache-dir -r requirements.txt \ + --default-timeout=100 \ + -i https://pypi.tuna.tsinghua.edu.cn/simple COPY . . diff --git a/docker-compose.yml b/docker-compose.yml index d17136b..0b76b74 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,7 @@ services: env_file: - .env ports: - - "${DJANGO_PORT:-8000}:${DJANGO_PORT:-8000}" + - "${DJANGO_PORT:-6789}:${DJANGO_PORT:-8000}" volumes: - static_volume:/app/staticfiles - jsonl_archive:/app/archive diff --git a/manage.py b/manage.py index e629861..ed9a044 100644 --- a/manage.py +++ b/manage.py @@ -4,6 +4,7 @@ import sys def main(): + sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "src")) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings") try: from django.core.management import execute_from_command_line diff --git a/scripts/sync_sessions.py b/scripts/sync_sessions.py index 7ea9f9f..ac4d495 100755 --- a/scripts/sync_sessions.py +++ b/scripts/sync_sessions.py @@ -205,9 +205,9 @@ def parse_jsonl(file_path): msg_data = { "session_id": session_id, "message_id": msg_id, - "parent_id": parent_id, + "parent_id": parent_id or "", "seq": message_seq, - "role": role, + "role": role or "", "content_text": content_text, "raw_content": content_items if content_items else [], "raw_message": event.get("content", []),