From 4cccccc2d716d244abf45d26d3b4546b032d5529 Mon Sep 17 00:00:00 2001 From: Aakash Singh Date: Thu, 1 Feb 2024 23:46:05 +0530 Subject: [PATCH] fix start script (#456) --- compose/production/django/entrypoint | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/compose/production/django/entrypoint b/compose/production/django/entrypoint index 599841ed..e61c71aa 100644 --- a/compose/production/django/entrypoint +++ b/compose/production/django/entrypoint @@ -20,17 +20,12 @@ postgres_ready() { python << END import sys -import psycopg2 +import psycopg try: - psycopg2.connect( - dbname="${POSTGRES_DB}", - user="${POSTGRES_USER}", - password="${POSTGRES_PASSWORD}", - host="${POSTGRES_HOST}", - port="${POSTGRES_PORT}", - ) -except psycopg2.OperationalError: + psycopg.connect(conninfo="${DATABASE_URL}") +except psycopg.OperationalError as e: + print(e) sys.exit(-1) sys.exit(0)