Render Bokeh Plot in Html template Without using Flask

Hi Team,
I am trying to embed a bokeh plot into html. But i am not able to render. Hers is my code.

from bokeh.plotting import figure
from import curdoc
from bokeh.layouts import row
p = figure(title='One sample graph',
            toolbar_location=None)[1,2,3,4,5],[6,7,2,5,4], size=15)

curdoc().add_root(row(p, name='plotrow'))


{% extends base %}
{% block preamble %}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="" rel="stylesheet">
<link rel="stylesheet" href="app/static/special.css">
{% endblock %}
{% block contents %}
<div class="background">
<div class="header">
<h2>Some more text</h2>
<p>Even more text</p>
<div class="bar"></div>
<div class="container">{{ embed(roots.plotrow) }}</div>
<div class="footer">
<p>Some extra text <br/>By someone</p>
{% endblock %}

I tried to run my bokeh using the following command(doing this on aws ubuntu vm). Plot is rendering but not embed into html template.

CMD: bokeh serve --show

this is my plot. please have a look.

Please help me on this.


In order to make use of all the extra features of Directory Format apps (e.g. automatically loading a template file) you need to invoke bokeh serve on the directory containing not on itself. The docs have a complete description of the expected layout.

I just noticed this was cross-country posted to stack overflow. Please make sure that there are cross links in both posts so that an answer in one place ensures an answer is accessible anywhere.

Thanks Bryan, Working as expected.