PostgreSQL with SQLalchemy database is not found

前端 未结 1 968
[愿得一人]
[愿得一人] 2021-01-29 00:39

I am using the following code to create postgresql database using sqlalchemy:

engine=create_engine(\'postgresql+psycopg2://postgres@localhost/testData\')
Base.me         


        
相关标签:
1条回答
  • 2021-01-29 01:11

    You need to create the database beforehand, create_all just creates the tables. To create database: sudo -u postgres createdb testData.

    0 讨论(0)
提交回复
热议问题