|
|
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
|
|