Skip to content

database.db not appearing in website folder #165

@SpookySimon

Description

@SpookySimon

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions