I am facing a problem with flask url routing; it seems routes are not working as expected.
Under
project/src/views.py, I have the following sample routesfrom flask import (Flask,request,jsonify,Blueprint) my_view = Blueprint('my_view', __name__) @my_view.route('/',methods=("GET",)) @my_view.route('/index',methods=("GET",)) def index(): .... <return response code here> @my_view.route("/key/<inp1>/<inp2>", methods=("POST","GET")) def getKey(inp1=None, inp2=None): .... <return response code here>Now, under
project/src/app.py, I have the following codefrom ../src.views import my_view my_app = Flask("myappname") my_app.register_blueprint(my_view) my_app.run(debug=True,host=APP_IP,port=APP_PORT)
Now, when I access the URL http://ip:port/index or http://ip:port/key... with valid parameters, it returns 404, with the message "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again." I believe mentioned routes are not working.