diff --git a/compose/production/django/entrypoint b/compose/production/django/entrypoint index 599841e..e61c71a 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)