Commit 4529ff6e authored by sim's avatar sim

Database host and port are generated parameters

parent a627b4af
......@@ -5,8 +5,8 @@ DEBUG = {DEBUG}
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = {SECRET_KEY}
# PostgreSQL access
DB_HOST = 127.0.0.1
DB_PORT = 5432
DB_HOST = {DB_HOST}
DB_PORT = {DB_PORT}
DB_NAME = {DB_NAME}
DB_USER = {DB_USER}
DB_PASS = {DB_PASS}
......
......@@ -45,6 +45,8 @@ echo "PostgreSQL configuration..."
DB_NAME_DEFAULT=gargandb
DB_USER_DEFAULT=gargantua
DB_HOST=127.0.0.1
DB_PORT=5432
while :; do
read -p "Database name [$DB_NAME_DEFAULT]: " DB_NAME
......@@ -79,6 +81,8 @@ DB_PASS=$(escape_ini "$DB_PASS")
echo "Generate configuration file from $TEMPLATE..."
sed -E -e "s/[{]DEBUG[}]/$DEBUG/g" \
-e "s/[{]SECRET_KEY[}]/$SECRET_KEY/g" \
-e "s/[{]DB_HOST[}]/$DB_HOST/g" \
-e "s/[{]DB_PORT[}]/$DB_PORT/g" \
-e "s/[{]DB_NAME[}]/$DB_NAME/g" \
-e "s/[{]DB_USER[}]/$DB_USER/g" \
-e "s/[{]DB_PASS[}]/$DB_PASS/g" \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment