File size: 282 Bytes
164aab4
 
 
 
 
41c0212
21712df
008c795
164aab4
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import psycopg2

def connect_to_db():
    conn = psycopg2.connect(
        dbname="neondb",
        user=os.getenv("postgre_user"),
        password=os.getenv("postgre_pass"),
        host=os.getenv("postgre_host"),
        port=5432,
        sslmode="require"
    )
    return conn