Flask-Web-App-Tutorial icon indicating copy to clipboard operation
Flask-Web-App-Tutorial copied to clipboard

database.db not appearing in website folder

Open SpookySimon opened this issue 2 months ago • 2 comments

def create_database(app): if not path.exists('website/' + DB_NAME): with app.app_context(): db.create_all() print('Created Database!') else:print("Database exists")

Replaced the old app=app and got no errors. However even thow i get the msg Db created i can't seem to see it. When i look for it it appears in website folder but in my Pycharm Community Edition it doesn't appear. I run the main 6-7 times. Every time i got the msg Db created and it still doesn't appear. After some tries a folder called instances pops up and it has the db txt file inside. Important to say that i didn't change anything in the code, just rerun the same code. I got rid of the instances and transfered db under website. Now everything works. Posting this because i didn't see any relavant article. Hope to get some feedback on why this happened. Thank you!

SpookySimon avatar Dec 01 '24 19:12 SpookySimon