Skip to content

Instantly share code, notes, and snippets.

@crawftv
Created May 31, 2019 05:47
Show Gist options
  • Save crawftv/21d3804e41496473980a9f438c13def4 to your computer and use it in GitHub Desktop.
Save crawftv/21d3804e41496473980a9f438c13def4 to your computer and use it in GitHub Desktop.
connecting to postgres database
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