Pass data from Django Template to Django Dash App

i have a problem passing data from template to django dash app to use it in charts .
this i the template that pass the data to django dash app and the error message


First make sure you’re using a Dash version prior to 1.21. 0

Then, adjust the initial arguments your are passing to pick out a value for a particular dash component. See the tag documentation which contains a brief description of the format.

You probably need something like {'(whatever the id is for your Input, please paste real code not screenshots to make it readable)': {'value': device.DeviceIP}} set as dash_context in your monitorDevice view.

hello @delsim ,
I have the same problem (I can access the data in django template but i can not pass it to django dash app to use it in charts) but i am using plotly_direct so i can not add initial arguments as a parameter

how can i solve it please :sob:

and there is more details here: Pass Data From Django Templates to Dash App While using `plotly_direct`

There’s a couple of ideas here - essentially (a) use a different template tag or (b) create/update the dash app instance directly.

1 Like

This is a similar issue to this one so this response is similar: there are a couple of ideas here - essentially (a) use a different template tag or (b) create/update the dash app instance directly.