【Flask】from flask.ext.script import Manager

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

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

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

结果以下:
app

(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
ide

Done.this

本文仅做鼓励本身更新博客。spa

相关文章
相关标签/搜索