Skip to content

Commit 14469b0

Browse files
authored
fix postgresql problem
1 parent d17e545 commit 14469b0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/app.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
app.url_map.strict_slashes = False
1919

2020
# database condiguration
21-
if os.getenv("DATABASE_URL") is not None:
22-
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get('DATABASE_URL')
21+
db_url = os.getenv("DATABASE_URL")
22+
if db_url is not None:
23+
app.config['SQLALCHEMY_DATABASE_URI'] = db_url.replace("postgres://", "postgresql://")
2324
else:
2425
app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:////tmp/test.db"
2526

0 commit comments

Comments
 (0)