Make use of app context in flask.