☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Can't solve how to use layout, gridplot, ... with django standalone

Community Support
Stefan23
Stefan23

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.

⌁   Link to post

End of archived discussion · Replies are disabled