Created
May 31, 2019 05:47
-
-
Save crawftv/21d3804e41496473980a9f438c13def4 to your computer and use it in GitHub Desktop.
connecting to postgres database
This file contains hidden or 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 psycopg2 | |
import sqlalchemy | |
from decouple import config | |
#AWS_DATABASE_URL is 'postgres://username:password@database-instance-name.randomchars.us-east-2.rds.amazonaws.com:5432/databaseName | |
host = config('AWS_DATABASE_URL') | |
db = sqlalchemy.create_engine(host) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment