✊🏿 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!

App updates only after I save my sourcecode

Hi,

I have a multi-page app where I upload files, save them to a database and feed the fileslist back to a datatable for display.

Unfortunately the newly uploaded files to the database (succesfully uploaded) do not display right away. Even after a site refresh. They only update if I save my sourcefile with the code.

Did anyone have similar problems?

Also if I wrap my layout into a function and call

layout = serve_layout

I get an error:

dash.exceptions.InvalidCallbackReturnValue: 
The callback for `<Output `page-content.children`>`
returned a value having type `function`
which is not JSON serializable.

The value in question is either the only value returned,
or is in the top level of the returned list,
and has string representation
`<function serve_layout at 0x11eb1e730>`

In general, Dash properties can only be
dash components, strings, dictionaries, numbers, None,
or lists of those.

On the other hand, if I write:

layout = serve_layout()

everything works well.

Has anybody any idea? Any help would be appreciated.

Thank you