From the Flask docs:
def index():
pass
app.add_url_rule('/', 'index', index)
It also says:
endpoint – the endpoint for the registered URL rule. Flask itself assumes the name of the view function as endpoint
Indeed, if I do app.add_url_rule('/', None, index) it all seems to work fine. (I'm not sure of the terminology and what an "endpoint" actually is.)
Some further questions:
Is there any reason to specify the second argument?
Is the second argument indeed the "endpoint"?
What are the benefits/drawbacks of (not) specifying the second argument?
What if the same name is used in another url rule? Is the first overwritten? Is this intended?