Could not determine dialect for SQlite, following Flask tutorial

前端 未结 1 898
星月不相逢
星月不相逢 2021-01-28 21:37

I am following this tutorial which is brilliant to learn Flask.

I typed in all the code to create a database using SQLAlchemy-Migrate , but when I run db_create.py

1条回答
  •  伪装坚强ぢ
    2021-01-28 22:00

    You have an error in your SQLALCHEMY_DATABASE_URI connection string; the driver value is case sensitive, you cannot capitalize SQLite in it, it has to be all lowercase:

    SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db')
    

    The exception you see is thrown by SQLAlchemy trying to use the first part of the connection string to find the right database dialect, and it won't find SQLite, but will work for sqlite.

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