connect.py 319 B

1234567891011
  1. import psycopg2 as pg
  2. from FlaskApp.BackendApi.config import host, user, db_name, password
  3. def connect():
  4. try:
  5. print('Connecting to the PostgreSQL Database...')
  6. conn1 = f"postgresql://postgres@192.168.1.98/postgres"
  7. print("Success database connect!")
  8. return conn1
  9. except:
  10. print('Connection Has Failed...')