From c782a1db68416d2729bbee33aa946a57c32b9c82 Mon Sep 17 00:00:00 2001 From: ahmed531998 Date: Tue, 4 Apr 2023 21:41:45 +0200 Subject: [PATCH] db_added --- main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index b51e76f..49aecf0 100644 --- a/main.py +++ b/main.py @@ -27,7 +27,8 @@ url = os.getenv("FRONTEND_URL_WITH_PORT") cors = CORS(app, resources={r"/predict": {"origins": url}, r"/feedback": {"origins": url}}) conn = psycopg2.connect( - host="https://janet-app-db.d4science.org", + host="janet-pg", + port=5432, database=os.getenv("POSTGRES_DB"), user=os.getenv("POSTGRES_USER"), password=os.getenv("POSTGRES_PASSWORD")) @@ -103,7 +104,7 @@ def feedback(): data['fluency'], data['truthfulness'], data['usefulness'], data['speed'], data['intent']) ) - + conn.commit() reply = jsonify({"status": "done"}) return reply @@ -166,5 +167,5 @@ if __name__ == "__main__": 'response_time_feedback text NOT NULL,' 'response_intent text NOT NULL);' ) - + conn.commit() app.run(host='127.0.0.1', port=4000)