cookiecutter-django does not set env variables for DATABASE_URL and CELERY_BROKER_URL during "entrypoint" file execution in local development environment.
After I manually 'exported' DATABASE_URL and CELERY_BROKER_URL they appeared in environment variables. Why is that?
By manually I mean I got inside the docker container then on the shell I wrote:
export DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"
and
export CELERY_BROKER_URL="${REDIS_URL}"
It might be because the environment variable
DJANGO_READ_DOT_ENV_FILE
is set toFalse
by default. Set it toTrue
in your runtime environment and it will start reading the.env
file and theDATABASE_URL
in it: