Forums

Having issues in flask nested blueprints

I have some issue in creating children blueprint inside of another

Father blueprint

api_v2_bp = Blueprint("api_v2_bp", name, url_prefix="/api/v2") from .iset.iset_bp import iset_api_bp api_v2_bp.register_blueprint(iset_api_bp)

@api_v2_bp.route("/", methods=["GET"]) def get_api_v2(): return jsonify({"message": "Hello from API v2!"})

My iset iset_api_bp flile

:::python iset_api_bp = Blueprint("iset_api_v2", name, url_prefix="iset") @iset_api_bp.route("/", methods=["GET"]) def get_iset(): return jsonify({"message": "Hello from ISET API v2!"})

When i access the url "/api/v2/iset" i get a 404 error, when i test local works fine and get the expected response, what i'm doing wrong?

When i access the /api/v2/ is working ok

Are you sure that all of those definitions are in code that is actually run?

Yes, i make this new feature push today, the v2 is not in the older version, the father blueprint is working, so i confirmed is the new version of the code is running

Was the web app reloaded after the code was pulled?

Yes

A 404 error for an endpoint just means that you have not defined the route. It looks like you will need to work out why the route that you think you defined is not actually defined.