python - PeeWee PostgreSQL Database creation: does not exist -
i'm attempting create postgresql database using peewee
. upon connecting following error:
file "peewee_test.py", line 44, in
psql_db.connect()
file "c:\python27\lib\site-packages\peewee.py", line 3602, in connect
self.initialize_connection(self._local.conn)
file "c:\python27\lib\site-packages\peewee.py", line 3514, in exit
reraise(new_type, new_type(*exc_args), traceback)
file "c:\python27\lib\site-packages\peewee.py", line 3600, in connect
**self.connect_kwargs)
file "c:\python27\lib\site-packages\playhouse\postgres_ext.py", line 385, in _connect
conn = super(postgresqlextdatabase, self)._connect(database, **kwargs)
file "c:\python27\lib\site-packages\peewee.py", line 3990, in _connect
conn = psycopg2.connect(database=database, **kwargs)
file "c:\python27\lib\site-packages\psycopg2__init__.py", line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
peewee.operationalerror: fatal: database "test" not exist
any idea doing wrong?
from peewee import * playhouse.postgres_ext import postgresqlextdatabase psql_db = postgresqlextdatabase( 'test', # required peewee. user='xxxxx', # passed directly psycopg2. password='xxxxx', # ditto. host='', # ditto. port='5432' ) psql_db.connect() # error occurs here psql_db.create_tables([person, pet])
Comments
Post a Comment