HTRegister.py
from flask import Blueprint
from controllers.registerDAO import Register
register = Blueprint("register", __name__, url_prefix="/register")
# 这里以register.route注册的函数都会自带/register,所以url是/register/select
@register.route('/select', methods=["POST"])
def HTRegiste_selectr():
info = Register().select()
return {"info": info}
注册蓝图
from flask import Flask, request, render_template
from controllers.V1.HTRegister import register
app = Flask(__name__)
# 注册蓝图
app.register_blueprint(register)
标签:__,Blueprint,蓝图,Python,register,Flask,import
From: https://www.cnblogs.com/QingshanY/p/17128685.html