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/

相关文章:

  • 2021-08-15
  • 2021-08-15
  • 2021-08-15
  • 2021-08-15
  • 2021-07-15
  • 2021-10-28
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-08
  • 2021-10-14
  • 2022-12-23
  • 2021-10-09
  • 2021-07-06
相关资源
相似解决方案