mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-22 17:47:08 +03:00
Refactor POSTGRES_HOST env
This commit is contained in:
parent
b4b3c04253
commit
906299ae39
|
@ -115,6 +115,7 @@ Consider the aforementioned ``.envs/.local/.postgres``: ::
|
|||
|
||||
# PostgreSQL
|
||||
# ------------------------------------------------------------------------------
|
||||
POSTGRES_HOST=postgres
|
||||
POSTGRES_DB=<your project slug>
|
||||
POSTGRES_USER=XgOWtQtJecsAbaIyslwGvFvPawftNaqO
|
||||
POSTGRES_PASSWORD=jSljDz4whHuwO3aJIgVBrqEml5Ycbghorep4uVJ4xjDYQu0LfuTZdctj7y0YcCLu
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# PostgreSQL
|
||||
# ------------------------------------------------------------------------------
|
||||
POSTGRES_HOST=postgres
|
||||
POSTGRES_DB={{ cookiecutter.project_slug }}
|
||||
POSTGRES_USER=!!!SET POSTGRES_USER!!!
|
||||
POSTGRES_PASSWORD=!!!SET POSTGRES_PASSWORD!!!
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# PostgreSQL
|
||||
# ------------------------------------------------------------------------------
|
||||
POSTGRES_HOST=postgres
|
||||
POSTGRES_DB={{ cookiecutter.project_slug }}
|
||||
POSTGRES_USER=!!!SET POSTGRES_USER!!!
|
||||
POSTGRES_PASSWORD=!!!SET POSTGRES_PASSWORD!!!
|
||||
|
|
|
@ -14,7 +14,7 @@ if [ -z "${POSTGRES_USER}" ]; then
|
|||
base_postgres_image_default_user='postgres'
|
||||
export POSTGRES_USER="${base_postgres_image_default_user}"
|
||||
fi
|
||||
export DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}"
|
||||
export DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:5432/${POSTGRES_DB}"
|
||||
|
||||
postgres_ready() {
|
||||
python << END
|
||||
|
@ -27,7 +27,7 @@ try:
|
|||
dbname="${POSTGRES_DB}",
|
||||
user="${POSTGRES_USER}",
|
||||
password="${POSTGRES_PASSWORD}",
|
||||
host="postgres"
|
||||
host="${POSTGRES_HOST}"
|
||||
)
|
||||
except psycopg2.OperationalError:
|
||||
sys.exit(-1)
|
||||
|
|
|
@ -25,7 +25,7 @@ if [[ "${POSTGRES_USER}" == "postgres" ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
export PGHOST="postgres"
|
||||
export PGHOST="${POSTGRES_HOST}"
|
||||
export PGUSER="${POSTGRES_USER}"
|
||||
export PGPASSWORD="${POSTGRES_PASSWORD}"
|
||||
export PGDATABASE="${POSTGRES_DB}"
|
||||
|
|
|
@ -37,7 +37,7 @@ if [[ "${POSTGRES_USER}" == "postgres" ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
export PGHOST="postgres"
|
||||
export PGHOST="${POSTGRES_HOST}"
|
||||
export PGUSER="${POSTGRES_USER}"
|
||||
export PGPASSWORD="${POSTGRES_PASSWORD}"
|
||||
export PGDATABASE="${POSTGRES_DB}"
|
||||
|
|
Loading…
Reference in New Issue
Block a user