From 475b8abd658d1e7378588f2c13d86e9dbf101aee Mon Sep 17 00:00:00 2001 From: pedro Date: Fri, 8 Nov 2024 15:55:04 +0100 Subject: [PATCH] improve .env and docker-reset --- .env.example | 10 +++++----- docker-reset.sh | 5 +++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index 37ed087..ed60e95 100644 --- a/.env.example +++ b/.env.example @@ -1,16 +1,16 @@ DOMAIN=localhost -DEMO=false +DEMO=true +# note that with DEBUG=true, logs are more verbose (include tracebacks) +DEBUG=true +ALLOWED_HOSTS=localhost,localhost:8000,127.0.0.1, STATIC_ROOT=/tmp/static/ MEDIA_ROOT=/tmp/media/ -ALLOWED_HOSTS=localhost,localhost:8000,127.0.0.1, -DOMAIN=localhost -DEBUG=True EMAIL_HOST="mail.example.org" EMAIL_HOST_USER="fillme_noreply" EMAIL_HOST_PASSWORD="fillme_passwd" EMAIL_PORT=587 -EMAIL_USE_TLS=True +EMAIL_USE_TLS=true EMAIL_BACKEND="django.core.mail.backends.smtp.EmailBackend" EMAIL_FILE_PATH="/tmp/app-messages" ENABLE_EMAIL=false diff --git a/docker-reset.sh b/docker-reset.sh index bf14db2..9dc0032 100755 --- a/docker-reset.sh +++ b/docker-reset.sh @@ -14,6 +14,11 @@ main() { if [ "${DETACH:-}" ]; then detach_arg='-d' fi + + if [ ! -f .env ]; then + cp -v .env.example .env + echo "WARNING: .env was not there, .env.example was copied, this only happens once" + fi # remove old database sudo rm -vfr ./db/* docker compose down -v