From e4606cdbeb02abce848b6dd36dc2ce424c1d5594 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Thu, 7 Jan 2021 22:41:53 +1100 Subject: [PATCH] for now, we have a bookdb docker container with content and referenced in main.py --- README | 5 +---- main.py | 5 +++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README b/README index 3b83e67..5ed6b30 100644 --- a/README +++ b/README @@ -1,8 +1,5 @@ ### TODO: get all this inside a docker container and use compose to do the whole set (pg, flask, ?) - see this for postgresal: - https://hub.docker.com/_/postgres (has several env vars that should work out) - and probably this: - https://docs.docker.com/compose/gettingstarted/ (for flask and maybe redis) +https://docs.docker.com/compose/gettingstarted/ # flask -> python web server diff --git a/main.py b/main.py index 3194305..102e2c4 100644 --- a/main.py +++ b/main.py @@ -11,7 +11,12 @@ import re ####################################### Flask App globals ####################################### app = Flask(__name__) ### what is this value? I gather I should chagne it? + +# local DB conn string DB_URL = 'postgresql+psycopg2://ddp:NWNlfa01@127.0.0.1:5432/library' +# using temp.docker DB conn string +DB_URL = 'postgresql+psycopg2://ddp:blahdeblah@172.18.0.20:5432/library' + app.config['SQLALCHEMY_DATABASE_URI'] = DB_URL app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False app.config.from_mapping( SECRET_KEY=b'\xd6\x04\xbdj\xfe\xed$c\x1e@\xad\x0f\x13,@G')