我正在阅读 Quickstart Flask官方教程的一部分:
Invalid Import Name
The
-aargument to flask is the name of the module to import. In case that module is incorrectly named you will get an import error upon start (or if debug is enabled when you navigate to the application). It will tell you what it tried to import and why it failed.The most common reason is a typo or because you did not actually create an
appobject.
它提到了“flask 的 -a 参数”,但我在本文档的其余部分看不到任何关于 -a 的内容。此外,flask run -a foo.py 给我 Error: no such option: -a。
我的问题是:如何使用 -a 参数来指定 flask 运行的模块?
请您参考如下方法:
您的链接来自0.11 version .但是如果你去这个link (这是 0.12 版的 flask ),它不见了。 This提交应该证明它不可用的原因:)
