How can you set the standard static directory of the Bokeh server when using a customized Bokeh app

Hi,

I have the following question:

How can you set the standard static directory of the Bokeh server when using a customized Bokeh app?

I have sub-classed a Bokeh handler class, so that I can;

  1. Start Bokeh server via python code

  2. Give the server a function to modify the server document

  3. Manually set the template

  4. Manually set the static directory

The main reasons I have done this are;

  1. I want to be able to start the code from a run all script

  2. I want to be able to reuse code that lives outside my Bokeh dashboard module

When I set the static directory manually, the standard static directory is overwritten. The server is no longer able to find the Bokeh css and js files. As a work around I have to manually place the js and css files in the customized static directory.

When starting a standard Bokeh directory structure (main.py, /static/, /templates/, …) with the command line ‘bokeh serve --show “name”’ the static directory is added to the server, together with the standard static directory. When starting the same app manually the static directory is overwritten by the new one, the Bokeh css and js can no longer be found.

app = Application(DirectoryHandler())

server = Server(app)

server.run_until_shutdown()

This gives a standard 404 on all the Bokeh css and js files.

I think that the bokeh serve command sets the standard static directory and then adds the app static directory. Does anybody know if this can be done manually as well?

Thanks!