def schedule_api(self): """开启 API""" app.run('127.0.0.1', 5000)
from flask_web import app # 启动运行 if __name__ == '__main__': app.run(debug=True) # 这样子会直接运行在本地服务器,也即是 localhost:5000
import sys, os sys.path.append( os.path.dirname( os.path.dirname(os.path.dirname(os.path.realpath(__file__))))) # print() from flask_migrate import Migrate from flask_web import app, db, manager if __name__ == '__main__': # db.create_all() # manager.app.run() app.run(host="0.0.0.0", port=5000)
# coding:utf-8 from flask_web import app, db from flask_web.views.user import user app.register_blueprint(user, url_prefix="/") if __name__ == '__main__': app.run(port=5000)
#!/usr/bin/env python # -*- coding: utf-8 -*- from flask_web import app # Start development web server if __name__ == '__main__': app.debug = app.config['DEBUG'] app.run(host=app.config['HOST'], port=app.config['PORT'])