Set a default value for CELERY_BROKER_URL when docker usn't used - fixes #1741

This commit is contained in:
Bruno Alla 2018-08-14 23:09:11 +01:00
parent 36f3558ccc
commit 03636a9dbe

View File

@ -233,7 +233,12 @@ if USE_TZ:
# http://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-timezone # http://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-timezone
CELERY_TIMEZONE = TIME_ZONE CELERY_TIMEZONE = TIME_ZONE
# http://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-broker_url # http://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-broker_url
{% if cookiecutter.use_docker == 'y' -%}
CELERY_BROKER_URL = env('CELERY_BROKER_URL') CELERY_BROKER_URL = env('CELERY_BROKER_URL')
{%- else %}
CELERY_BROKER_URL = env('CELERY_BROKER_URL', default="redis://localhost:6379")
{%- endif %}
# http://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-result_backend # http://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-result_backend
CELERY_RESULT_BACKEND = CELERY_BROKER_URL CELERY_RESULT_BACKEND = CELERY_BROKER_URL
# http://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-accept_content # http://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-accept_content