【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.

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

猜你喜欢

转载自www.cnblogs.com/leslieying/p/9154205.html