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

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

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2024-7-31 00:02:44 | 显示全部楼层 |阅读模式
db.create_all()/ `6 e8 E8 A3 m7 {1 G1 w/ J3 Z3 e
Traceback (most recent call last):
, t% u; y0 w0 T0 }; i' J  File "F:\Program Files\JetBrains\PyCharm Community Edition 2023.2.1\plugins\python-ce\helpers\pydev\pydevconsole.py", line 364, in runcode
; y8 M, h/ r  A. n0 ^" e* E- O4 ^    coro = func()3 c- e! X" h( `; A% _
           ^^^^^^7 @- F$ E" @6 L$ A# m  u
  File "<input>", line 1, in <module>% r1 y$ E) ?3 N6 Y
  File "G:\Users\longrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\flask_sqlalchemy\extension.py", line 900, in create_all
$ n; _+ }* x6 M$ F+ M' C' H8 L    self._call_for_binds(bind_key, "create_all")* l4 d8 F/ W' y, L! ]* x
  File "G:\Users\longrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\flask_sqlalchemy\extension.py", line 871, in _call_for_binds( P! W& Z& l* I3 G7 e% `' T2 h
    engine = self.engines[key]- C9 R( E/ w  t, `6 g8 Q& ^
             ^^^^^^^^^^^^+ s2 c1 m, x7 j% m3 u
  File "G:\Users\longrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\flask_sqlalchemy\extension.py", line 687, in engines* C& m1 }; H( T
    app = current_app._get_current_object()  # type: ignore[attr-defined]& Z, j2 ^, k+ T/ W
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6 S- S5 f' P* b. T; s. ~4 U  File "G:\Users\longrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\werkzeug\local.py", line 519, in _get_current_object
( K+ k, K: p: `4 j' V% d6 F: a    raise RuntimeError(unbound_message) from None5 Y4 Z4 k  Q" P* d2 s) q$ b
RuntimeError: Working outside of application context.5 K3 \9 y: W9 i: U; i" F
This typically means that you attempted to use functionality that needed
. R) X6 x5 P7 f6 b) w- z: h/ ?9 zthe current application. To solve this, set up an application context
4 \6 P5 q) v, _0 ?( t. jwith app.app_context(). See the documentation for more information.' R5 |* ?! S4 O- a, D- \; g
4 H" _3 z  A: y
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 01:20 , Processed in 0.015530 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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