I want to choose the name of the function below a decorator dynamically (during runtime):
@app.server.route('/downloadable/<path:path>')
def the_name_which_I_actually_would_like_to_set_dynamically(path):
pass
UPDATE:
This is a more specific code sample. The first call of create_endpoint
works fine, however I get an error for the second call of create_endpoint
import dash
from flask import Flask
server = Flask(__name__)
app = dash.Dash(server=server)
app.config['suppress_callback_exceptions']=True
def create_endpoint(function_name = "test_function_name"):
@app.server.route('/downloadable/<path:path>')
def test_function_name(path):
pass
create_endpoint()
create_endpoint()
-->
AssertionError: View function mapping is overwriting an existing endpoint function: test_function_name