MCPcopy Index your code
hub / github.com/plotly/dash / create_app

Function create_app

tests/integration/test_patch.py:406–432  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

404def test_pch004_duplicate_output_restart(dash_duo_mp):
405 # Duplicate output ids should be the same between restarts for the same ids
406 def create_app():
407 app = Dash(__name__)
408 app.layout = html.Div(
409 [
410 html.Button("Click 1", id="click1"),
411 html.Button("Click 2", id="click2"),
412 html.Div(id="output"),
413 ]
414 )
415
416 @app.callback(
417 Output("output", "children", allow_duplicate=True),
418 Input("click1", "n_clicks"),
419 prevent_initial_call=True,
420 )
421 def on_click(_):
422 return "click 1"
423
424 @app.callback(
425 Output("output", "children", allow_duplicate=True),
426 Input("click2", "n_clicks"),
427 prevent_initial_call=True,
428 )
429 def on_click(_):
430 return "click 2"
431
432 return app
433
434 dash_duo_mp.start_server(create_app())
435

Callers 1

Calls 1

DashClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…