# Live Updates with mutipage app-

**URL:** <https://community.plotly.com/t/live-updates-with-mutipage-app/41737>\
**Category:** Dash Python\
**Created:** [June 29, 2020, 7:10pm UTC](https://community.plotly.com/t/live-updates-with-mutipage-app/41737 "2020-06-29T19:10:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bgivens33](https://avatars.discourse-cdn.com/v4/letter/b/e68b1a/32.png) [@bgivens33](https://community.plotly.com/u/bgivens33)\
**Post date:** [June 29, 2020, 7:10pm UTC](https://community.plotly.com/t/live-updates-with-mutipage-app/41737/1 "2020-06-29T19:10:51Z")

</div>

I’ve got a multipage app that isn’t updating upon refresh. I’ve recreated a very basic example.

index.py →

```auto
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
from test_page import overviewLayout
from app import app

def serve_layout():
    tmpLayout = html.Div([
    dcc.Location(id='url', refresh=False),
    html.Div(id='main-content1')])
    return tmpLayout

app.config.suppress_callback_exceptions= True
app.layout = serve_layout

@app.callback(Output('main-content1', 'children'),
              [Input('url', 'pathname')])
def display_page(pathname):
    if pathname=='/':
        return overviewLayout
    else:
        return html.H3('COMING SOON')

if __name__ == ' __main__':
    app.run_server(debug=False,port=8051,host=('0.0.0.0'))

```

app.py-\>

```auto
app = dash.Dash(
    __name__ )
server = app.server

```

test\_page.py →

```auto
overviewLayout = [
    html.H1('The time is: ' + str(datetime.datetime.now()))

]

```

---

<div class="post-metadata">

**Author:** ![chriddyp](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/chriddyp/32/16855_2.png) [@chriddyp](https://community.plotly.com/u/chriddyp)\
**Post date:** [June 29, 2020, 9:03pm UTC](https://community.plotly.com/t/live-updates-with-mutipage-app/41737/2 "2020-06-29T21:03:16Z")

</div>

try changing overviewLayout to be a function. currently it is a variable which means it’s imported and evaluated when you run python index.py rather than when you load the page and the callback is evalauated.

---

<div class="post-metadata">

**Author:** ![bgivens33](https://avatars.discourse-cdn.com/v4/letter/b/e68b1a/32.png) [@bgivens33](https://community.plotly.com/u/bgivens33)\
**Post date:** [June 30, 2020, 2:26pm UTC](https://community.plotly.com/t/live-updates-with-mutipage-app/41737/3 "2020-06-30T14:26:57Z")

</div>

Ok, thanks. So that worked, but it’s now making load times pretty slow (which is expected). Can you shed a bit of light on what is happening? If I wrap my main layout in a function (the serve\_layout() function) it will refresh when I refresh the browser, but is the function actually re-executing? Because it will seemingly still point at old data unless I wrap the overviewLayout into a function as well. Am I understanding that correctly?
