Get data from another function to app callback. Django Plotly Dash
So I have this data in my views. py. and I’m passing the value to the iotData function that located in my Dash app called ph.py
in my views.py
from .overview import ph //this is my dash app//
def overview(request):
post_data = json.loads(request.body.decode("utf-8"))
value = post_data.get('data')
ph.iotData(value) //passing the data to this function//
return render(request, 'html')
ph.py
def iotData(value):
print(value) //printing the data that from my views.py//
@app.callback(Output('graph-ph', 'figure'),
[Input('interval-graph-update', 'n_intervals')],
[State('graph-ph', 'figure')])
def update_extend_traces_traceselect(n_intervals, fig_raw):
//I want to access iotData here so that I can use the data for my graph//
how can I pass the data from iotData to my app.callback function
If I did understand correctly your question, I think that this topic answers it
Please, let me know if it solves the problem