python - How to set Postgres username and password in the Flask Peewee ORM? -
i'm building website using python flask framework , peewee orm , postgresql database. worked fine when developing on mac. moved installation ubuntu 12.04 desktop testing on linux , run trouble postgresql. on mac, postgres server didn't seem require user , password (good devving, bad production). on ubuntu says
operationalerror: fatal: role "kramer65" not exist
kramer65 normal username in ubuntu , should obvious postgres doesn't know it. can log psql using postgres user, don't know how add peewee. i've got config file in have:
database = { 'name': 'mydb', 'engine': 'playhouse.postgres_ext.postgresqlextdatabase' }
i tried adding 'password': 'mypassword'
, 'username': 'myusername'
it, says operationalerror: invalid connection option "username"
.
any idea how can add username , password peewee connect postgresql database? tips welcome!
i never heard of peewee nor worked example postgres connection github. , since peewee seems use psycopg2 postgres connectivity, of connection options should apply.
you need use 'user': 'yourusername'
instead of 'username': 'yourusername'
.
Comments
Post a Comment