python-fun
python-fun copied to clipboard
RuntimeError: Working outside of application context
Hi
I was checking web app FLASK https://github.com/patrickloeber/python-fun/tree/master/webapps/flask
But I got this error:
RuntimeError: Working outside of application context.
This typically means that you attempted to use functionality that needed
the current application. To solve this, set up an application context
with app.app_context(). See the documentation for more information.
Hi,
Just change
db.create_all()
on
with app.app_context(): db.create_all()