Connecting to postgres via pg8000 from SqlAlchemy worked fine until I enabled SSL on postgres.
db = create_engine('postgresql+pg8000://user:pass@hostname/dbname', echo=True).connect()
Now it seems to fail with:
File "/Library/Python/2.7/site-packages/pg8000/core.py", line 872, in __init__
raise InterfaceError("communication error", exc_info()[1])
sqlalchemy.exc.InterfaceError: (InterfaceError) ('communication error', error(61, 'Connection refused')) None None
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…