I use Bokeh (not server) with Django in a class based view. I like to use the functions: layout, gridplot, … but they do not work
views.py:
# Solution 1 is working
script, div = components((plot1, plot2)) #
context['script'] = script
context['divs'] = div
# Solution 2 is NOT working
grid = gridplot([[plot1, plot2], [plot2, plot1]], plot_width=250, plot_height=250)
context['grid'] = grid
template.html
<h1>Solution 1: - working</h1>
{% for div in divs %}
{{div | safe}}
{% endfor %}
<h1>Solution 2 - NOT working:</h1>
{{ grid | safe }}
The rendered Page:
What to do to make gridplot work? I need two plots in one row and would prefer not to use html.