Fix Jinja2 templating in conf.py

This commit is contained in:
Andrew-Chen-Wang 2020-08-15 17:54:17 -04:00
parent 92cafc618f
commit 4757ed9bce

View File

@ -17,16 +17,16 @@ import django
if os.getenv("READTHEDOCS", default=False) == "True":
sys.path.insert(0, os.path.abspath(".."))
os.environ["DJANGO_READ_DOT_ENV_FILE"] = "True"
{% if cookiecutter.use_celery == 'y' -%}
{%- if cookiecutter.use_celery == 'y' %}
os.environ["CELERY_BROKER_URL"] = os.getenv("REDIS_URL", "redis://redis:6379")
{%- endif %}
os.environ["USE_DOCKER"] = "no"
master_doc = "_source/index"
else:
{% if cookiecutter.use_docker == 'y' %}
{%- if cookiecutter.use_docker == 'y' %}
sys.path.insert(0, os.path.abspath("/app"))
os.environ.setdefault("DATABASE_URL", "")
{% else %}
{%- else %}
sys.path.insert(0, os.path.abspath(".."))
{%- endif %}
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")