Standalone Bokeh server or combine with Flask?

Hi,

I’ve made a working integration of Bokeh into Flask using this example:

It works.

However after having studied the Bokeh user guide a bit more I am in doubt as to whether the Flask part is necessary at all.

What I want to do is create relatively simple, user specific dashboards available from the public internet. I will need some basic authentication and SSL-connection of course. As far as I can tell it is all possible using Bokeh and the underlying Tornado-server.

So my question really is if there is any obvious benefits from involving Flask also? My own initial thoughts were that it would be easier to use Flask for - amongst other things - authentication, templates and navigating between different URL’s in the web-app.

But my web-app is really a relatively simple dashboard, and I’m not even sure the app will have different URL’s. Thinking of just using a tabbed pane when and if necessary.

Any input would be much appreciated.

If you don’t otherwise need Flask for anything, you can refer to tornado_embed.py or standalone_embed.py. However, my actual advice, based on your description is to use standard bokeh serve capability, which would be even simpler:

Hi Bryan, thank you. Much appreciated. My most recent plan was actually to just use the bokeh serve-capability instead of the whole Flask-path I initially had started to venture down … I was just unsure whether I would lose critical functionality (authentication, SSL etc.) if I went with just Bokeh. It doesn’t seem like it, and I would be more than happy to just get rid of Flask for simplicity’s sake :slight_smile:

Nope, definitely not, and if you need to “scale out” the bokeh serve case is typically also simpler (just run several instances behind a load balancer).