Guest User

Untitled

a guest
Oct 3rd, 2018
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. import os
  2.  
  3. assert os.environ['PGUSER'] != '', os.environ
  4.  
  5. connection_string = \
  6. 'postgresql://{user}:{password}@{host}/{database}'.format(
  7. user=os.environ['PGUSER'],
  8. password=os.environ['PGPASSWORD'],
  9. host=os.environ['PGHOST'],
  10. database=os.environ['PGDATABASE'])
  11.  
  12. from sqlalchemy import create_engine
  13.  
  14. engine = create_engine(connection_string)
Add Comment
Please, Sign In to add comment