db_added
This commit is contained in:
parent
e1dfb0da74
commit
c782a1db68
7
main.py
7
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)
|
||||
|
|
Loading…
Reference in New Issue