I'm new to flask and I got stuck into one thing. So I have run.py
file inside it
from market import app
from market.models import db
if __name__ == "__main__":
with app.app_context():
db.create_all()
app.run(debug=True)
so when I call python run.py
the db.create_all()
function works. But when I call flask --app market run
or flask --app run.py run
the db.create_all()
doesn't get executed.
Please explain why this happens ?