/app.py
#!/usr/bin/python3
from flask import Flask
from controller.user import user_blueprint
app = Flask(__name__)
app.register_blueprint(user_blueprint)
if __name__ == '__main__':
app.run()
/controller/user.py
from flask import Blueprint
user_blueprint = Blueprint('user', __name__)
@user_blueprint.route('/user/add')
def user_add():
return '用户-add'
@user_blueprint.route('/user/del')
def user_del():
return '用户-del'
@user_blueprint.route('/user/update')
def user_update():
return '用户-update'
@user_blueprint.route('/user/list')
def user_list():
return '用户-list'
@user_blueprint.route('/user/info')
def user_info():
return '用户-info'
网友评论