Thanks for the reply.
View page Code:
from django.shortcuts import render
from django.http import HttpResponse
from bokeh.io import output_file, show
from bokeh.plotting import figure
from bokeh.embed import components
from bokeh.resources import CDN
from bokeh.models.widgets import Select
from bokeh.layouts import column, row,layout
def home(request):
select = Select(title="Option:", value="foo", options=['Yes','no'])
fruits = ['Apples', 'Pears', 'Nectarines', 'Plums', 'Grapes', 'Strawberries']
counts = [5, 3, 4, 2, 4, 6]
p = figure(x_range=fruits, plot_height=350, title="Fruit Counts",
toolbar_location=None, tools="")
p.vbar(x=fruits, top=counts, width=0.9)
p.xgrid.grid_line_color = None
p.y_range.start = 0
lay_out = layout([select],[p])
script, div = components(lay_out)
cdn_js=CDN.js_files
#cdn_css=CDN.css_files[0]
return render(request,'demo_app/bokeh_cdn.html',{'title':'RPA','script': script, 'div':div,'cdn_js':cdn_js})
HTML Template:
{% extends "demo_app/base.html"%}
{%block content%}
<!--<script type="text/javascript" src={{cdn_js | safe}}></script>-->
<script type="text/javascript" scr="https://cdn.bokeh.org/bokeh/release/bokeh-2.0.2.min.js" ></script>
<script type="text/javascript" scr="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.0.2.min.js" ></script>
<script type="text/javascript" scr="https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.0.2.min.js" ></script>
<script type="text/javascript" scr="https://cdn.bokeh.org/bokeh/release/bokeh-api- 2.0.2.min.js" ></script>
<div class="home">
<h1>My about page</h1>
<p>This is a test website again</p>
</div>
{{script | safe}}
{{div | safe}}
{%endblock%}