Embedding a Panel (> 0.7.0) app in Django

I have some Panel apps that I’ve embedded in Django. I used bokeh.core.templates.AUTOLOAD_JS to configure the Bokeh models and this seemed to work for Panel when I was using Panel 0.7.0. I’ve since updated my Panel apps, but just recently tested them in Django. I’ve tested Panel 0.8.0 and 0.9.1, but I get the following error with both:

Error rendering Bokeh items: Error: Model 'panel.models.markup.HTML' does not exist. This could be due to a widget or a custom model not being registered before first usage.

Is there something else that needs to be done to configure the custom Panel models now, in addition to what is being handled by AUTOLOAD_JS?

It looks like I’m still getting the error with Panel 0.7.0, but just at a later stage in the Pipeline. I reverted back to Panel 0.6.4 and was able to proceed through all of the stages in my pipeline.

Which version of Bokeh are you using with these releases?

In general I’m using Bokeh 1.4.0. The exception is for Panel 9.1 since it requires Bokeh >= 2.0. I’ve also tried using Bokeh 2.0 with Panel 0.8.

Could you file an issue on the Panel repo? I’ll ping @mattpap about it. We should also add an example to the Django app in the repo so we can at least manually test this is working.

1 Like