flask.cli.NoAppException: Could not import "hello"

一、前言

  在学习flask的时候,运行python -m flask run命令,启动程序报如下问题
  

二、解决方案

  在要运行的py文件下运行,比如此处的hello.py还有上一层目录test,需要切换到hello.py的目录下,运行python -m flask run

三、结果

    

web端显示

=============================================================================

知道、想到、做到、得到
原文地址:https://www.cnblogs.com/Durant0420/p/14242099.html