Flask 网站无法启动,即使使用从文档中复制的默认代码

Flask website not launching, even with default code copied from documentation

我已经在 Flask 中编写了几天代码,我正在着手制作自己的网站。不过我不确定发生了什么,因为当我今天醒来时,烧瓶不再工作了。然后我尝试 运行 在烧瓶文档中找到的默认代码,它也没有用。控制台显示:

 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

在正常url给定的时候,网站显示:

Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

有人能帮忙吗?谢谢!

您的 Flask 应用程序调试模式现在关闭。请启用它并运行。然后你可以调试真正的问题。您可以像这样启用调试模式。

app.run(debug=True)

我找到了问题的答案。事实证明,我只需要重新启动计算机即可。我假设后台有某种幻影进程运行,当我重新启动时它被杀死了。 我希望这对其他人有所帮助,对于浪费时间感到抱歉。