From 96ab40723eb19bfa33b05d8b1cc43313f826f20c Mon Sep 17 00:00:00 2001 From: "Ehsan.Asadi" Date: Wed, 31 Dec 2025 08:14:33 +0330 Subject: [PATCH] [REVERT] Back to app_name=peikarband - Reflex requires it (fix) | ApprovalToken: AT-202512310814 --- docker/Dockerfile | 16 ++++++++-------- peikarband/{landing => peikarband}/__init__.py | 0 peikarband/rxconfig.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) rename peikarband/{landing => peikarband}/__init__.py (100%) diff --git a/docker/Dockerfile b/docker/Dockerfile index 90210c6..aee1f06 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -54,11 +54,11 @@ COPY peikarband/ /build/peikarband/ # This allows both peikarband.peikarband and src.* imports to work ENV PYTHONPATH=/build:/build/peikarband -# Verify that peikarband.landing can be imported before running reflex +# Verify that peikarband.peikarband can be imported before running reflex # This helps catch import errors early -RUN cd /build && \ - python3 -c "from peikarband.landing import app; print('✅ peikarband.landing.app imported successfully')" && \ - echo "Import test passed" +# RUN cd /build && \ +# python3 -c "from peikarband.peikarband import app; print('✅ peikarband.peikarband.app imported successfully')" && \ +# echo "Import test passed" # Initialize Reflex and build frontend from peikarband directory # Reflex needs to run from the directory containing rxconfig.py @@ -120,7 +120,7 @@ RUN groupadd -r peikarband && \ WORKDIR /app # Note: We keep WORKDIR=/app (not /app/peikarband) to avoid Python importing -# /app/peikarband/landing/ as the peikarband package incorrectly +# /app/peikarband/peikarband/ as the peikarband package incorrectly # The entrypoint script will cd to /app/peikarband before running reflex # Base image already has everything we need: @@ -134,8 +134,8 @@ WORKDIR /app COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages COPY --from=builder /usr/local/bin /usr/local/bin -# Copy application code to /app/peikarband/ to create peikarband.landing structure -# With app_name="landing", Reflex expects to find peikarband.landing module +# Copy application code to /app/peikarband/ to create peikarband.peikarband structure +# With app_name="peikarband", Reflex expects to find peikarband.peikarband module COPY --from=builder --chown=peikarband:peikarband /build/peikarband /app/peikarband # Copy entrypoint script @@ -154,7 +154,7 @@ RUN chmod -R 755 /app && \ # PYTHONPATH includes both /app and /app/peikarband # - /app: allows importing peikarband from /app/peikarband/ # - /app/peikarband: allows importing src from /app/peikarband/src/ -# This makes both peikarband.landing and src.* imports work correctly +# This makes both peikarband.peikarband and src.* imports work correctly # REFLEX_DIR points to the directory containing rxconfig.py ENV PYTHONUNBUFFERED=1 \ PYTHONDONTWRITEBYTECODE=1 \ diff --git a/peikarband/landing/__init__.py b/peikarband/peikarband/__init__.py similarity index 100% rename from peikarband/landing/__init__.py rename to peikarband/peikarband/__init__.py diff --git a/peikarband/rxconfig.py b/peikarband/rxconfig.py index 379bdc2..95486f8 100644 --- a/peikarband/rxconfig.py +++ b/peikarband/rxconfig.py @@ -13,7 +13,7 @@ BACKEND_PORT = int(os.getenv("BACKEND_PORT", "8000")) DB_URL = os.getenv("DATABASE_URL", "sqlite:////app/data/reflex.db") config = rx.Config( - app_name="landing", + app_name="peikarband", api_url=API_URL, frontend_port=FRONTEND_PORT, backend_port=BACKEND_PORT,