How to implement a initially variative layout?

Imagine that my initial layout depends on the logged in user. I know that app.layout can be passed a function, but seems there are no any arguments passed to it.
(I use django-plotly-dash)
I mean before any callback are fired.


I managed to do it like this:

app.layout = html.Div(id='layout')

    Output('layout', 'children'),
    [Input('layout', 'id')]
def output_layout(*args, user, **kwargs):

but now when this function renders my layout - it does not get filled with data - no callbacks called

In a running server, app.layout can (and will) be called multiple times, not just when first rendering the app, so it is not a good place to put anything other than the definition of the overall app structure. You might find it better to either change the content of the app inside callback functions, or have multiple apps, depending on your particular use case.