Open notaryanramani opened 2 years ago
I am getting the same issue and I am using the original source code with no modifications...
This is because flask-sqlalchemy update in 3.0 look up here https://flask-sqlalchemy.palletsprojects.com/en/3.0.x/quickstart/#create-the-tables
update your code to this
def create_database(app):
if not path.exists('website/' + DB_NAME):
with app.app_context():
db.create_all()
print('Created Database!')
your database will created in folder \instance\database.db
This is because flask-sqlalchemy update in 3.0 look up here https://flask-sqlalchemy.palletsprojects.com/en/3.0.x/quickstart/#create-the-tables
update your code to this
def create_database(app): if not path.exists('website/' + DB_NAME): with app.app_context(): db.create_all() print('Created Database!')
your database will created in folder \instance\database.db
Thank you so much, was getting very confused myself.
thanks dude, u saved my life... XD
thanks for sharing. My db is created in a folder called: instance folder anyone kow why and how to revert it to the website folder?
Thank you for the help.. Solved my problem