From 867e2ad629a03a5678dc5bea87fcd06b94099599 Mon Sep 17 00:00:00 2001 From: Demetris Stavrou Date: Thu, 21 Jun 2018 23:11:08 +0300 Subject: [PATCH 1/2] Redis config in local is now conditional on Celery. --- {{cookiecutter.project_slug}}/.envs/.local/.django | 2 ++ 1 file changed, 2 insertions(+) diff --git a/{{cookiecutter.project_slug}}/.envs/.local/.django b/{{cookiecutter.project_slug}}/.envs/.local/.django index 8aa9a994..a145c6bc 100644 --- a/{{cookiecutter.project_slug}}/.envs/.local/.django +++ b/{{cookiecutter.project_slug}}/.envs/.local/.django @@ -2,6 +2,8 @@ # ------------------------------------------------------------------------------ USE_DOCKER=yes +{%- if cookiecutter.use_celery == 'y' %} # Redis # ------------------------------------------------------------------------------ REDIS_URL=redis://redis:6379/0 +{% endif %} From 6f638078ebe6edcf6b1930658ba2ee4451c94c95 Mon Sep 17 00:00:00 2001 From: Demetris Stavrou Date: Fri, 22 Jun 2018 17:32:10 +0300 Subject: [PATCH 2/2] Moved CELERY_BROKER_URL definition to .django env file to resolve error when Celery is not used (PR #1693) --- {{cookiecutter.project_slug}}/.envs/.production/.django | 7 +++++++ .../compose/production/django/entrypoint.sh | 3 --- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/.envs/.production/.django b/{{cookiecutter.project_slug}}/.envs/.production/.django index 2e9eefea..1203ce64 100644 --- a/{{cookiecutter.project_slug}}/.envs/.production/.django +++ b/{{cookiecutter.project_slug}}/.envs/.production/.django @@ -43,3 +43,10 @@ DJANGO_SENTRY_DSN= # Redis # ------------------------------------------------------------------------------ REDIS_URL=redis://redis:6379/0 + +{% if cookiecutter.use_celery == "y" %} +# Celery +# ------------------------------------------------------------------------------ +CELERY_BROKER_URL=redis://redis:6379/0 + +{% endif %} \ No newline at end of file diff --git a/{{cookiecutter.project_slug}}/compose/production/django/entrypoint.sh b/{{cookiecutter.project_slug}}/compose/production/django/entrypoint.sh index 74242bde..ae0858e1 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/entrypoint.sh +++ b/{{cookiecutter.project_slug}}/compose/production/django/entrypoint.sh @@ -7,9 +7,6 @@ set -o nounset cmd="$@" -# N.B. If only .env files supported variable expansion... -export CELERY_BROKER_URL="${REDIS_URL}" - if [ -z "${POSTGRES_USER}" ]; then base_postgres_image_default_user='postgres' export POSTGRES_USER="${base_postgres_image_default_user}"