Eric J Ma's Website

Serving multiple Panel apps together

written by Eric J. Ma on 2019-12-26 | tags: data science dashboarding python


I learned a new thing today! If I have a bunch of small dashboard-like utilities, panel, which uses the bokeh server behind the scenes, can serve up multiple files together from the same server.

Here's an example. Assume I have the following directory structure:

|- /
  |- app1.py
  |- app2.py
  |- app3.py

If I start a Panel server here using:

panel serve *.py
# or, to be selective
panel serve src1.py src2.py src3.py

If you have a bunch of Jupyter notebooks, the analogous command is:

panel serve *.ipynb
# or, to be selective:
panel serve nb1.ipynb nb2.ipynb nb3.ipynb

Then all of the apps will be served up, with a default Bokeh landing page provided to link to each of the apps.

Doing so lets us build multiple little utilities that can help ourselves and our colleagues be more productive!

For an example of this, check out the minimal panel app I built to record these ideas. (Source code is available here.)


Cite this blog post:
@article{
    ericmjl-2019-serving-together,
    author = {Eric J. Ma},
    title = {Serving multiple Panel apps together},
    year = {2019},
    month = {12},
    day = {26},
    howpublished = {\url{https://ericmjl.github.io}},
    journal = {Eric J. Ma's Blog},
    url = {https://ericmjl.github.io/blog/2019/12/26/serving-multiple-panel-apps-together},
}
  

I send out a newsletter with tips and tools for data scientists. Come check it out at Substack.

If you would like to sponsor the coffee that goes into making my posts, please consider GitHub Sponsors!

Finally, I do free 30-minute GenAI strategy calls for teams that are looking to leverage GenAI for maximum impact. Consider booking a call on Calendly if you're interested!