I am a beginner in flask - Python. I am facing an issue with multiple routing. I had gone through google searches. But didn't get the full idea of how to implement it. I have developed an flask application where i need to reuse the same view function for different urls.
@app.route('/test/contr',methods=["POST", "GET"],contr=None)
@app.route('/test/primary', methods=["POST", "GET"])
def test(contr):
if request.method == "POST":
if contr is None:
print "inter"
else:
main_title = "POST PHASE"
...
I want to call test function for 2 routing..& have different in few functionalities, except that all other are same. So i though of reusing. But not getting how to differentiate routing inside the test function using some parameters passing from function which redirects the call to this test function.
I couldn't find a good tutorial which defines basics of multiple routing from scratch