From 8bb8c10930e109321f32ea4530c9e5b27c567a93 Mon Sep 17 00:00:00 2001 From: Marc Aymerich Date: Thu, 1 Oct 2015 19:12:31 +0000 Subject: [PATCH] Fixes on deployment --- orchestra/management/commands/setuppostgres.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/orchestra/management/commands/setuppostgres.py b/orchestra/management/commands/setuppostgres.py index 97e8e89b..ae177c5c 100644 --- a/orchestra/management/commands/setuppostgres.py +++ b/orchestra/management/commands/setuppostgres.py @@ -56,12 +56,12 @@ class Command(BaseCommand): if run("grep '^DATABASES\s*=\s*{' %(settings)s" % context, valid_codes=(0,1)).exit_code == 0: # Update existing settings_file run(textwrap.dedent("""\ - sed -i "s/'ENGINE': '[^']*',/'ENGINE': 'django.db.backends.postgresql_psycopg2',/" %(settings)s - sed -i "s/'NAME': '[^']*',/'NAME': '%(db_name)s',/" %(settings)s - sed -i "s/'USER': '[^']*',/'USER': '%(db_user)s',/" %(settings)s - sed -i "s/'PASSWORD': '[^']*',/'PASSWORD': '%(db_password)s',/" %(settings)s - sed -i "s/'HOST': '[^']*',/'HOST': '%(db_host)s',/" %(settings)s - sed -i "s/'PORT': '[^']*',/'PORT': '%(db_port)s',/" %(settings)s\ + sed -i "s/'ENGINE':[^#]*/'ENGINE': 'django.db.backends.postgresql_psycopg2',/" %(settings)s + sed -i "s/'NAME':[^#]*/'NAME': '%(db_name)s',/" %(settings)s + sed -i "s/'USER':[^#]*/'USER': '%(db_user)s',/" %(settings)s + sed -i "s/'PASSWORD':[^#]*/'PASSWORD': '%(db_password)s',/" %(settings)s + sed -i "s/'HOST': [^#]*/'HOST': '%(db_host)s',/" %(settings)s + sed -i "s/'PORT': [^#]*/'PORT': '%(db_port)s',/" %(settings)s\ """) % context ) else: