- 积分
- 16841
在线时间 小时
最后登录1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?开始注册
x
db.create_all()
- C; _9 P! i; P# E& o$ OTraceback (most recent call last):0 R9 t* g9 {; f* }
File "F:\Program Files\JetBrains\PyCharm Community Edition 2023.2.1\plugins\python-ce\helpers\pydev\pydevconsole.py", line 364, in runcode- a3 G. p# I4 ?
coro = func()
( T! V' K7 m( T ^^^^^^
5 D" t( {" ^, e! X6 [. d! m" ?. t) k. l File "<input>", line 1, in <module>
R/ f# I! j$ _ O File "G:\Users\longrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\flask_sqlalchemy\extension.py", line 900, in create_all* g3 S' K4 o6 ~& j- `' l* |
self._call_for_binds(bind_key, "create_all")* E+ N7 N; U; h* s, w m- y
File "G:\Users\longrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\flask_sqlalchemy\extension.py", line 871, in _call_for_binds1 u) u# `% _7 I; {8 V2 }" ~: V
engine = self.engines[key]7 q) m) K0 |4 N. [7 ^* _
^^^^^^^^^^^^
0 J+ W" C( k3 Q File "G:\Users\longrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\flask_sqlalchemy\extension.py", line 687, in engines3 {! r. T9 ~$ M0 J l
app = current_app._get_current_object() # type: ignore[attr-defined]
; a1 y; z/ k7 @7 l- @ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
$ O1 O) Z8 d$ Z U9 k File "G:\Users\longrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\werkzeug\local.py", line 519, in _get_current_object
+ G) Q% ]( l$ e7 b( n& L4 i5 k' k A0 G raise RuntimeError(unbound_message) from None
7 Y' P% k G8 \1 O* F- NRuntimeError: Working outside of application context.
% v9 d$ U8 l: E/ rThis typically means that you attempted to use functionality that needed L, m) E$ T/ ^1 _6 k6 ~& o1 \/ l
the current application. To solve this, set up an application context8 C( |. H! w% C( Y0 N9 B
with app.app_context(). See the documentation for more information.
8 L6 Z3 z @( O# i* k! B* Y) q, V8 g4 X5 c
|
|