diff --git a/config/settings/local.py b/config/settings/local.py index ccaf43208c..477f287315 100644 --- a/config/settings/local.py +++ b/config/settings/local.py @@ -19,8 +19,9 @@ # django-silk # ------------------------------------------------------------------------------ # https://github.com/jazzband/django-silk#requirements -INSTALLED_APPS += ["silk"] -MIDDLEWARE += ["silk.middleware.SilkyMiddleware"] +if env("ENABLE_SILK", default=False): + INSTALLED_APPS += ["silk"] + MIDDLEWARE += ["silk.middleware.SilkyMiddleware"] # https://github.com/jazzband/django-silk#profiling SILKY_PYTHON_PROFILER = True diff --git a/docker/.local.env b/docker/.local.env index b00327fc9b..9d7dc6043a 100644 --- a/docker/.local.env +++ b/docker/.local.env @@ -7,7 +7,8 @@ DATABASE_URL=postgres://postgres:postgres@db:5432/care REDIS_URL=redis://redis:6379 CELERY_BROKER_URL=redis://redis:6379/0 -DJANGO_DEBUG=False +DJANGO_DEBUG=true +ATTACH_DEBUGGER=false BUCKET_REGION=ap-south-1 BUCKET_KEY=key diff --git a/docker/dev.Dockerfile b/docker/dev.Dockerfile index 9bbb9e492a..6b605913d8 100644 --- a/docker/dev.Dockerfile +++ b/docker/dev.Dockerfile @@ -31,9 +31,9 @@ RUN ARCH=$(dpkg --print-architecture) && \ rm -rf typst.tar.xz typst-${TYPST_ARCH} # use pipenv to manage virtualenv -RUN pip install pipenv==2024.4.0 - RUN python -m venv /.venv +RUN --mount=type=cache,target=/root/.cache/pip pip install pipenv==2024.4.0 + COPY Pipfile Pipfile.lock $APP_HOME/ RUN --mount=type=cache,target=/root/.cache/pip pipenv install --system --categories "packages dev-packages docs" diff --git a/scripts/start-dev.sh b/scripts/start-dev.sh index 1071bc6f67..f220165d5d 100755 --- a/scripts/start-dev.sh +++ b/scripts/start-dev.sh @@ -11,9 +11,9 @@ python manage.py collectstatic --noinput python manage.py compilemessages -v 0 echo "starting server..." -if [[ "${DJANGO_DEBUG,,}" == "true" ]]; then +if [[ "${ATTACH_DEBUGGER}" == "true" ]]; then echo "waiting for debugger..." - python -m debugpy --wait-for-client --listen 0.0.0.0:9876 manage.py runserver_plus 0.0.0.0:9000 + python -m debugpy --wait-for-client --listen 0.0.0.0:9876 manage.py runserver_plus 0.0.0.0:9000 --print-sql else - python manage.py runserver 0.0.0.0:9000 + python manage.py runserver_plus 0.0.0.0:9000 --print-sql fi