- 积分
- 16843
在线时间 小时
最后登录1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?开始注册
x
db.create_all()
( C) k! V+ U. gTraceback (most recent call last):: V3 X0 x2 ^$ v% p
File "F:\Program Files\JetBrains\PyCharm Community Edition 2023.2.1\plugins\python-ce\helpers\pydev\pydevconsole.py", line 364, in runcode
. D: n1 W/ [; f coro = func() F2 I$ |! S/ o; x
^^^^^^
* {- p# y" u5 t; v' S- Q$ m File "<input>", line 1, in <module>6 @, c# F% R" E) Q: w; v# i
File "G:\Users\longrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\flask_sqlalchemy\extension.py", line 900, in create_all
& V0 i+ ~' w) m$ a- ~- z self._call_for_binds(bind_key, "create_all")2 Y7 v4 M/ L1 D9 P, b* t- N" S
File "G:\Users\longrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\flask_sqlalchemy\extension.py", line 871, in _call_for_binds
- J( Q0 Y" ] E @ engine = self.engines[key]
% S( b$ n1 E$ F4 b, m ^^^^^^^^^^^^
* z$ w7 q0 T2 S" Q$ b# D0 q/ ]' Z2 U File "G:\Users\longrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\flask_sqlalchemy\extension.py", line 687, in engines2 J( l( _: m* `- M
app = current_app._get_current_object() # type: ignore[attr-defined]8 I6 R/ s1 A9 }2 w8 x/ c
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^+ q' f. X- n0 P, u) G8 `6 P
File "G:\Users\longrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\werkzeug\local.py", line 519, in _get_current_object
* A4 C; {1 c, L6 B. e raise RuntimeError(unbound_message) from None \; Y, C9 Y" h
RuntimeError: Working outside of application context.5 r6 h7 M! K/ a3 r- m
This typically means that you attempted to use functionality that needed9 l |7 ?% r1 n
the current application. To solve this, set up an application context6 O. K- @( G9 \2 G
with app.app_context(). See the documentation for more information.4 Y+ j; J+ E8 Q. B3 V& m4 [
1 U: V' o! A x2 D& ~
|
|