zhangshufei8001 阅读(17) 评论(0)

在看<<flask web开发>>文章中第16页,在做示例2-3时,

from flask import Flask
app = Flask(__name__)
from flask.ext.script import Manager
manager = Manager(app)

def user(name):
    return '<h1>Hello, %s!</h1>' % name

if __name__=='__main__':

E:\Python36>python hello.py
hello.py:42: ExtDeprecationWarning: Importing flask.ext.script is deprecated, use flask_script instead.
  from flask.ext.script import Manager
usage: hello.py [-?] {shell,runserver} ...

positional arguments:
    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


这里面告诉了我们两条有用的信息,第一条就是,我们应该导入from flask_script import Manager

第二条就是运行的时候,我们应该写成E:\Python36>python hello.py runserver