Eric J Ma's Website

PyViz Panel Apps

written by Eric J. Ma on 2019-07-26 | tags: data science data products app deployment


I finally learned how to build and serve apps with Panel!

Here are the key ideas:

  1. Prototype the app inside a Jupyter notebook. That gives the real-time feedback on whether your apps/widgets are working or not.
  2. The most important thing is that the final thing you package together is now a .servable() object.
  3. Use Panel’s serve command to test the app locally. It’s actually quite magical - the serve command can actually parse a Jupyter notebook and serve it up on a local web server.
  4. When you’ve confirmed that everything is working properly locally, Heroku is a great deployment option. Using the default Python buildpack and a requirements.txt file, one can easily specify the exact Python environment for deployment.

As a pedagogical implementation, I put up a minimal panel app on GitHub, and also served it up on Heroku. Come check it out! I hope it’s useful for you.


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

If you would like to receive deeper, in-depth content as an early subscriber, come support me on Patreon!