From 9c46a0b4c62f61a0e431dc6f34d4e0d7af2bdf49 Mon Sep 17 00:00:00 2001 From: evan kirkiles Date: Thu, 15 Dec 2022 23:36:10 -0500 Subject: [PATCH] Tried to change DB_URL again. --- psiturk/db.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/psiturk/db.py b/psiturk/db.py index c0426e2c..46238fa8 100644 --- a/psiturk/db.py +++ b/psiturk/db.py @@ -20,6 +20,10 @@ # internally use `mysql+pymysql://` so sqlalchemy talks to # the pymysql package DATABASE = DATABASE.replace('mysql://', 'mysql+pymysql://') +if 'postgres://' in DATABASE.lower(): + # internally use `mysql+pymysql://` so sqlalchemy talks to + # the pymysql package + DATABASE = DATABASE.replace('postgres://', 'postgresql://') engine = create_engine(DATABASE, echo=False, pool_recycle=3600) db_session = scoped_session(sessionmaker(autocommit=False,