Created
August 15, 2017 06:11
-
-
Save kunpengku/610c13b5b707aaaaba7a43dbf7239fa2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding:utf8 | |
from flask_script import Manager | |
from flask import Flask | |
app = Flask(__name__) | |
@app.route("/user/<name>") | |
def hello_you(name=None): | |
return "hello {name}".format(name=name) | |
manager = Manager(app) | |
@manager.command | |
def hello(): | |
print ("hello") | |
@manager.command | |
def runserver(host=None, port=None, debug=None): | |
"""Run a flask development server""" | |
app.run( | |
host=host or '0.0.0.0', | |
port=port or '5000', | |
use_debugger=True, | |
) | |
if __name__ == "__main__": | |
manager.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment