|
|
楼主 |
发表于 2024-5-28 13:56:24
|
显示全部楼层
访问报错信息:
7 m8 J) A; T* u x, }( s4 dflask.cli.NoAppException
2 t: S. o, d& M5 O$ x3 p9 Y( ?- [7 j
flask.cli.NoAppException: Could not import "app".
6 [: M) ?# G8 e h8 FTraceback (most recent call last)
6 {0 t* }8 x' L, Y5 c2 X
5 {# U' X& |% x6 D' {2 v6 S* c) c5 e File "C:\Users\admin\Desktop\test_flask\venv\Lib\site-packages\flask\cli.py", line 240, in locate_app
& |; G- U8 s# J3 @8 L& C* R) b+ @% E+ i7 J
__import__(module_name)
* ?0 R" T& V2 s$ B1 k
& r2 f" ]' q6 Z2 V; \& }5 i; ` t During handling of the above exception, another exception occurred:: n0 s6 f# G) K) Z* h
File "C:\Users\admin\Desktop\test_flask\venv\Lib\site-packages\flask\cli.py", line 338, in __call__
1 U( W7 q/ I# _/ t* d5 ?7 W* o ~5 C7 t( m
self._flush_bg_loading_exception()% i2 z, K/ ~6 u. U* t$ J- J
& b9 g% N: ^" c' H l4 O File "C:\Users\admin\Desktop\test_flask\venv\Lib\site-packages\flask\cli.py", line 326, in _flush_bg_loading_exception! b2 ]( U! u7 G- f9 \! h0 `
( w+ n1 W% U/ [" a6 X; E reraise(*exc_info)" S3 x- Z8 H; q. n
, M8 C/ \: `+ ?# t( o$ B, ]) } File "C:\Users\admin\Desktop\test_flask\venv\Lib\site-packages\flask\_compat.py", line 39, in reraise
2 w2 ^+ ?5 d- m0 b w) j. v) O
( V2 k+ a, T# E% F+ a raise value
+ A5 K9 P+ u9 u) T, x) F
j0 Z, E' t; e7 z File "C:\Users\admin\Desktop\test_flask\venv\Lib\site-packages\flask\cli.py", line 314, in _load_app I# } ?7 f r/ {3 W) M7 e
0 Y; u& r+ L% t0 T W9 |& q self._load_unlocked()
) X+ V: i, H, \2 r9 z: Q$ B' s0 k1 Q, G& T
File "C:\Users\admin\Desktop\test_flask\venv\Lib\site-packages\flask\cli.py", line 330, in _load_unlocked
+ u# a! x3 K V# F% ~6 x! g0 D% Z5 f, V" v) @5 ~% T- J
self._app = rv = self.loader()2 r* d5 {% H3 l2 F- }7 \8 L
9 g; w" L+ @8 ~9 Y5 F File "C:\Users\admin\Desktop\test_flask\venv\Lib\site-packages\flask\cli.py", line 388, in load_app5 h$ ^ F- W, I& _
: s S! D& O8 G: n) F4 [$ c* f' ] app = locate_app(self, import_name, name)
1 ~% J3 b& u8 X- `# u2 r- ]3 b; n6 N9 p" X$ p& R1 C" X
File "C:\Users\admin\Desktop\test_flask\venv\Lib\site-packages\flask\cli.py", line 250, in locate_app* ?' D8 g+ M8 L3 t
4 }1 B, e, _- ~/ \ O4 o
raise NoAppException('Could not import "{name}".'.format(name=module_name))
1 X, N- G$ ~" C- i# `- V( D) i* T; Y+ G
6 t- J0 C9 g3 `; P; U6 F flask.cli.NoAppException: Could not import "app".1 |2 U( q( a; O' _. x8 c8 `
2 ~& ?8 h* ]- h9 d2 o
The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error.
8 x( d# j' Z+ f* b
7 L. c* z) j% t2 sTo switch between the interactive traceback and the plaintext one, you can click on the "Traceback" headline. From the text traceback you can also create a paste of it. For code execution mouse-over the frame you want to debug and click on the console icon on the right side.2 {: U" w; z; z6 N
5 d$ {; r! t/ l0 P
You can execute arbitrary Python code in the stack frames and there are some extra helpers available for introspection:
+ |$ q2 ?+ S& [# \
. h w$ L3 K( a4 s1 I' \7 b- T dump() shows all variables in the frame
% U* t& G6 u2 p" k4 k dump(obj) dumps all that's known about the object8 d6 r+ i/ A% R
- @9 w) c8 G7 G3 A; J( k$ |
|
|