【Flask】from flask.ext.script import Manager

按照 Fask Web Development 中的代码 from flask.ext.script import Manager

结果报错 ImportError: No module named 'flask.ext'

经查询,官方已经修改了语法from flask_script import Manager

结果如下:

(venv) leslie@leslie-Lenovo-G400 ~/flasky/venv $ python hello.py
usage: hello.py [-?] {shell,runserver} ...

positional arguments:
  {shell,runserver}
    shell            Runs a Python shell inside Flask application context.
    runserver        Runs the Flask development server i.e. app.run()

optional arguments:
  -?, --help         show this help message and exit

Done.

本文仅作鼓励自己更新博客。

posted @ 2018-06-08 10:14  lesliepython  阅读(397)  评论(0)    收藏  举报