app = Dash(__name__)
app.layout = html.Div([
dcc.Location(id='url', refresh=False),
html.Div(id='page-content'),
])
@app.callback(
Output('page-content', 'children'),
Input('url', 'search')
)
def url_check(search):
project_key = re.search('project_key=(\w+)&', search).group(1)
if project_key == 'U9sD0DItDJ0479kiFPG8':
app.layout = html.Div([
dcc.Dropdown(options=['bar', 'pie'], id='dropdown', multi=False, value='bar',
placeholder='Select graph type'),
html.Div(id='page-content'),
])
return app.layout
else:
app.layout = html.Div([
html.Div('실패')
])
return app.layout
This is my code
When i receive Url first
match Url and my code then want to show dropdown, graph
but dont match then show 실패
how to do that>?