定义
from flask import Blueprint
from . import dataApi
def register_url():
bp = Blueprint('layers', __name__, url_prefix='/<regex("[0-9a-zA-Z-]+"):system>/<SN>/<source>/<project_id>')
bp.add_url_rule('/layerInfo', view_func=dataApi.get_layer_info, endpoint='layerInfo', methods=('GET',))
return bp
注册
from apps.layers import register_url as layers_url
app.register_blueprint(layers_url())
标签:blueprint,layers,flask,url,bp,import
From: https://www.cnblogs.com/yimeimanong/p/17374838.html