# Missing Callbacks in Multi Page App

**URL:** <https://community.plotly.com/t/missing-callbacks-in-multi-page-app/50299>\
**Category:** Dash Python\
**Created:** [February 22, 2021, 12:30pm UTC](https://community.plotly.com/t/missing-callbacks-in-multi-page-app/50299 "2021-02-22T12:30:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![HansPeter123](https://avatars.discourse-cdn.com/v4/letter/h/3be4f8/32.png) [@HansPeter123](https://community.plotly.com/u/HansPeter123)\
**Post date:** [February 22, 2021, 12:30pm UTC](https://community.plotly.com/t/missing-callbacks-in-multi-page-app/50299/1 "2021-02-22T12:30:11Z")

</div>

Hi everyone,

I am working for quite some time now with Dash Multi Page Apps without any issues. Now I am creating a new boilerplate that incorporates the dash-bootstrap-components. My problem is that not only in this new directory but in all other previous multi page Apps all callbacks seem to be ignored (and they don’t show up in the callback graph in debug mode). I am splitting the code into different files like it is shown in the official docs. However when I put everything in one file it works. As an example I used the code from the docs ([URL Routing and Multiple Apps | Dash for Python Documentation | Plotly](https://dash.plotly.com/urls)):

```auto
# this works fine!
import dash
import dash_core_components as dcc
import dash_html_components as html

app = dash.Dash( __name__ , suppress_callback_exceptions=True)

app.layout = html.Div([
    dcc.Location(id='url', refresh=False),
    html.Div(id='page-content')
])

index_page = html.Div([
    dcc.Link('Go to Page 1', href='/page-1'),
    html.Br(),
    dcc.Link('Go to Page 2', href='/page-2'),
])

page_1_layout = html.Div([
    html.H1('Page 1'),
    dcc.Dropdown(
        id='page-1-dropdown',
        options=[{'label': i, 'value': i} for i in ['LA', 'NYC', 'MTL']],
        value='LA'
    ),
    html.Div(id='page-1-content'),
    html.Br(),
    dcc.Link('Go to Page 2', href='/page-2'),
    html.Br(),
    dcc.Link('Go back to home', href='/'),
])

@app.callback(dash.dependencies.Output('page-1-content', 'children'),
              [dash.dependencies.Input('page-1-dropdown', 'value')])
def page_1_dropdown(value):
    return 'You have selected "{}"'.format(value)

page_2_layout = html.Div([
    html.H1('Page 2'),
    dcc.RadioItems(
        id='page-2-radios',
        options=[{'label': i, 'value': i} for i in ['Orange', 'Blue', 'Red']],
        value='Orange'
    ),
    html.Div(id='page-2-content'),
    html.Br(),
    dcc.Link('Go to Page 1', href='/page-1'),
    html.Br(),
    dcc.Link('Go back to home', href='/')
])

@app.callback(dash.dependencies.Output('page-2-content', 'children'),
              [dash.dependencies.Input('page-2-radios', 'value')])
def page_2_radios(value):
    return 'You have selected "{}"'.format(value)

# Update the index
@app.callback(dash.dependencies.Output('page-content', 'children'),
              [dash.dependencies.Input('url', 'pathname')])
def display_page(pathname):
    if pathname == '/page-1':
        return page_1_layout
    elif pathname == '/page-2':
        return page_2_layout
    else:
        return index_page
    # You could also return a 404 "URL not found" page here

if __name__ == ' __main__':
    app.run_server(debug=True)

```

I am using Python 3.8.8 and Dash 1.19

Can anyone help?

---

<div class="post-metadata">

**Author:** ![jnguyen0220](https://avatars.discourse-cdn.com/v4/letter/j/e480ec/32.png) [@jnguyen0220](https://community.plotly.com/u/jnguyen0220)\
**Post date:** [February 22, 2021, 5:26pm UTC](https://community.plotly.com/t/missing-callbacks-in-multi-page-app/50299/2 "2021-02-22T17:26:02Z")

</div>

I have a dash starter kit that allow you to split up all your component into separate files. Take a look at the router.py. it shoud give you a good example how to wiring up your solution. see the github repo below.

> **[jnguyen0220/dash-starter-kit](https://github.com/jnguyen0220/dash-starter-kit)**
>
> Dash plotly starter kit with routing and best practices

---

<div class="post-metadata">

**Author:** ![HansPeter123](https://avatars.discourse-cdn.com/v4/letter/h/3be4f8/32.png) [@HansPeter123](https://community.plotly.com/u/HansPeter123)\
**Post date:** [February 22, 2021, 8:20pm UTC](https://community.plotly.com/t/missing-callbacks-in-multi-page-app/50299/3 "2021-02-22T20:20:46Z")

</div>

Thank you I will check it out.
