Last active
April 12, 2023 15:08
-
-
Save srang992/fe00c7f062e4b9ca7686ef01cf947379 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pickle | |
import psycopg2 | |
# loading the file containing credentials | |
with open("heroku_database_credentials.pickle", "rb") as cred: | |
credential = pickle.load(cred) | |
# connecting to the postgresql database with those credentials | |
conn = psycopg2.connect(database=credential['Database'], | |
host=credential['Host'], | |
user=credential['User'], | |
port=credential['Port'], | |
password=credential['Password']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment