使用Flask遇到AttributeError: ‘Request‘ object has no attribute ‘is_xhr‘解决方案

遇到问题如下

···
AttributeError: 'Request' object has no attribute 'is_xhr'
127.0.0.1 - - [11/Jul/2022 16:21:52] "GET /?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 200 -
127.0.0.1 - - [11/Jul/2022 16:21:52] "GET /?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 200 -
127.0.0.1 - - [11/Jul/2022 16:21:52] "GET /?__debugger__=yes&cmd=resource&f=ubuntu.ttf HTTP/1.1" 200 -
127.0.0.1 - - [11/Jul/2022 16:21:52] "GET /?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -
127.0.0.1 - - [11/Jul/2022 16:21:52] "GET /?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -

进入所使用环境的终端中,降低Werkzeg版本即可,代码如下:

#卸载
pip uninstall werkzeug
#安装
pip install Werkzeug==0.16.1

经过上述步骤后运行服务即可

你可能感兴趣的:(python学习,flask,python,后端)