@app.route('/users/<path:path>')
def users(path=None):
    return str(path)
c = app.test_client()
print(c.get('/users'))
print(c.get('/users/'))
print(c.get('/users/test'))
Trailing slash triggers 404 in Flask path rule