✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

Serve_layout does not reload date on multipage app

Hi,

when using a multipage app (https://dash.plotly.com/urls), serve_layout (https://dash.plotly.com/live-updates) does not seem to work. Datetime is not updating, when reloading page.

app.py

import dash

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

app1.py

import dash_html_components as html
import datetime

from app import app

layout = html.H1('The time is: ' + str(datetime.datetime.now()))

index.py

import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output

from app import app
import app1


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

app.layout = serve_layout


@app.callback(Output('page-content', 'children'),
              [Input('url', 'pathname')])
def display_page(pathname):
    if pathname == '/apps/app1':
        return app1.layout
    else:
        return '404'

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