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