I have an authentication problem when trying to connect to db postgres using sqlalchemy. This is how I connect:
db_url = 'postgresql+psycopg2:///<role>:<pass>@localhost:5432/basketball'
Engine = create_engine(db_url, echo=False)
SessionMaker = ORM.sessionmaker(bind=Engine, autoflush=False)
Session = ORM.scoped_session(SessionMaker)
Here is how I installed /etc/postgresql/9.3/main/pg_hba.conf
local all postgres peer
local all all md5
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
Then when accessing db I get:
SQLAlchemy (psycopg2.OperationalError) fe_sendauth: no password supplied
source
share