This is the dummy example I was trying to run.
If dcc.Input (commented below) is not present this will not load even though this “gotcha” (Callbacks require their Inputs
, States
, and Output
to be present in the layout) implies that it should work?
any ideas what might be going on?
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
app = dash.Dash(__name__)
app.css.append_css({
'external_url': ('https://stackpath.bootstrapcdn.com/'
'bootstrap/4.1.1/css/bootstrap.min.css')
})
app.layout = html.Div([
html.Div(id='output'),
html.Button(id='button', children='click'),
html.Br(),
# dcc.Input(id='my-input', value='hello'),
])
app.config.suppress_callback_exceptions = True
@app.callback(
Output('output', 'children'),
[
Input('button', 'n_clicks'),
Input('my-input', 'value')
]
)
def update1(*args):
print('Out')
print(args)
print('Out - END')
return 'ok'
if __name__ == '__main__':
app.run_server(debug=True, port=8888)