Using index.html in server application

I have added an index.html file to add custom css_classes. The directory structure is as follows and impliments index.html when I run bokeh serve myapp.


My issue is that I don’t want users to run myapp directly. I want it to be used as a module that they import into their own script and then would run something like bokeh serve

This works, except that the the index.html file is not implemented. So far it seems that the user would be required to make their own script into a package structure and copy the templates directory into their own package. Is there a way to specify for the server to use the index.html file from the package that is being imported and not from the package that contains the users code?

You would need to set the template property of the Document via code. You can see how the DirectoryHandler loads and uses an index.html as a reference:

bokeh/ at branch-2.4 · bokeh/bokeh · GitHub

Perfect, thank you! Looking at how DirectoryHandler uses the template is what I needed. Thanks!