flask执行错误:
问题:RuntimeError: Working outside of application context.
方法:
from flask import Flask, current_app app = Flask(__name__) with app.app_context(): # within this block, current_app points to app. print current_app.name
参考:
http://stackoverflow.com/questions/33771465/runtimeerror-working-outside-of-application-context-when-learning-testing-flas
https://sentry.io/answers/flask-working-outside-of-application-context/