I am using bokeh with django. It’s not difficult to setup at all in comparison to flask. It’s pretty easy actually. As that reddit document shows and I can post my own code if you wish to use some of mine as a basic idea. You don’t need to use the bokeh server at all unless I misunderstood what your doing. I used the flask tutorial as a template and it works for Django too with a few minor modifications.
If anything you can do exactly what the flask tutorial does, just “pass the graph” yourself to the html page and it will update for you like I did.
If your using a django view function/class all you really need to do is just save the graph in the context {} variable and then use render() function to render it to the html page of interest like below where item data and data2 are the names of the graphs I wish to plot and json_dataxxx, json_datax and json_data2 are the graph its data an associated properties .
l = layout([plot], sizing_mode=‘scale_width’)
b = layout([p4], sizing_mode=‘scale_width’)
ab = layout([plot2], sizing_mode=‘fixed’)
item_text = json_item(l)
item_text3 = json_item(b)
item_text2 = json_item(ab)
json_dataxxx = json.dumps(item_text)
json_datax = json.dumps(item_text3)
json_data2 = json.dumps(item_text2)
context = {'item':json_dataxxx, 'data': json_datax, 'data2': json_data2}
return render(request, 'pathtohtml/htmlflename.html', context )
then use some basic javascript in your html page in the div container where you wish to place your graph of interest and your graph will be displayed and rendered where myplot2 is the name of the div container for the graph.
<script>
datax = {{data|safe}};
Bokeh.embed.embed_item(datax, "myplot2");
</script>