找回密码
 注册
查看: 14|回复: 0

调试报错 raise RuntimeError(unbound_message) from None RuntimeError: Working outsi

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2024-7-31 00:02:44 | 显示全部楼层 |阅读模式
db.create_all()
. B6 u. j# A- O' FTraceback (most recent call last):1 d0 Z, ], j2 w- q. ]) p
  File "F:\Program Files\JetBrains\PyCharm Community Edition 2023.2.1\plugins\python-ce\helpers\pydev\pydevconsole.py", line 364, in runcode$ j! W5 k5 x7 Y! Z' H
    coro = func()1 T% L( f( O5 I0 }
           ^^^^^^
% A. U! ?: X; }0 ?2 S. |  File "<input>", line 1, in <module>/ y) U1 P* ~% r$ x. V. T8 F- ?
  File "G:\Users\longrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\flask_sqlalchemy\extension.py", line 900, in create_all; j  x8 ?) l: t+ z( Y; D) p5 ?
    self._call_for_binds(bind_key, "create_all")# t! |; v( o! D/ F& v
  File "G:\Users\longrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\flask_sqlalchemy\extension.py", line 871, in _call_for_binds
6 _. {5 }4 k# a0 i, s    engine = self.engines[key]+ U" F2 i  k! n- x, T
             ^^^^^^^^^^^^
* j1 o, W2 Y. G0 y  File "G:\Users\longrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\flask_sqlalchemy\extension.py", line 687, in engines# z0 v6 r3 b* @6 v. D6 R
    app = current_app._get_current_object()  # type: ignore[attr-defined]
. j& \2 ^' L: r7 @- v          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# D8 e0 x% T* z  File "G:\Users\longrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\werkzeug\local.py", line 519, in _get_current_object/ W! K6 {6 c/ S! W8 ^6 c
    raise RuntimeError(unbound_message) from None
7 y/ v' v# t* W% l& v+ D9 }# g% xRuntimeError: Working outside of application context.( Z+ T/ K6 c7 |4 ?; ~7 O( Y4 \
This typically means that you attempted to use functionality that needed+ Q* L; i& b$ g, n+ {8 O0 ]/ Y
the current application. To solve this, set up an application context: p, C# V5 \4 p0 S" i- @
with app.app_context(). See the documentation for more information.
7 r2 b* N' O: p1 x8 ~/ l' t% W6 R( W$ f0 N! j
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 02:22 , Processed in 0.021769 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表