Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bokeh model does not exist

Tags:

django

bokeh

I have django bokeh project and I'm trying to add dateRangePicker slider but I get error in console

bokeh-0.12.16.min.js:1 Uncaught Error: Model 'DateRangeSlider' does not exist. This could be due to a widget
                     or a custom model not being registered before first usage.

This is code for that.

date_range_slider = DateRangeSlider(title="Date Range: ", start='2018-01-02', end='2018-06-09',
                                    value=('2018-06-02', '2018-06-09'), step=1)

# l = layout(children=[[date_range_slider]], sizing_mode='fixed')

l = layout(children=[[p], [date_range_slider]], sizing_mode='fixed')
script, div = components(l)
print(div)

return render(request, 'index.html', {"the_script": script, "the_div": div})

Do I need to add anything in django model?

like image 251
user2661518 Avatar asked Apr 18 '26 22:04

user2661518


1 Answers

Update: note that starting with Bokeh 2.0, there are only JS components to load (no separate CSS files)

BokehJS is split into multiple pieces so that users who do not need, e.g. widgets, do not have to load the extra JS and CSS for them. If you use widgets and components, you need to explicitly include the extra JS and CSS for them as described in the documentation

<link
    href="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-x.y.z.min.css"
    rel="stylesheet" type="text/css">

<script src="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-x.y.z.min.js"></script>
like image 51
bigreddot Avatar answered Apr 21 '26 17:04

bigreddot



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!