From 1975bbc36620f8f0addd18c5bd2d6b1ba6954ec8 Mon Sep 17 00:00:00 2001 From: JensDiemer Date: Sat, 2 Apr 2022 19:47:32 +0200 Subject: [PATCH] Bugfix DB settings Note: ``` db_name=$(ynh_sanitize_dbid --db_name="$app") db_user=$db_name ynh_app_setting_set --app="$app" --key=db_name --value="$db_name" ``` So `$db_name` is `django_fritzconnection`, but `$app` == `__APP__` is still `django-fritzconnection` ! --- conf/settings.py | 4 ++-- scripts/install | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/conf/settings.py b/conf/settings.py index 266cf85..af40036 100644 --- a/conf/settings.py +++ b/conf/settings.py @@ -73,8 +73,8 @@ MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', - 'NAME': '__APP__', - 'USER': '__APP__', + 'NAME': '__DB_NAME__', + 'USER': '__DB_USER__', 'PASSWORD': '__DB_PWD__', 'HOST': '127.0.0.1', 'PORT': '5432', # Default Postgres Port diff --git a/scripts/install b/scripts/install index 59c2632..f785a50 100755 --- a/scripts/install +++ b/scripts/install @@ -142,6 +142,8 @@ settings="$final_path/settings.py" cp "../conf/settings.py" "$settings" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$settings" +ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$settings" +ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$settings" ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$settings" ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$settings" ynh_replace_string --match_string="__ADMINMAIL__" --replace_string="$admin_mail" --target_file="$settings"