Panel: Enable Panel to serve or appear to serve static assets

Created on 23 Feb 2020  路  5Comments  路  Source: holoviz/panel

My Pain

I would like to be able to serve static assets to users of Panel.

  • This can be assets that are developed before I start the Panel server.
  • This can be assets that are generated by the user of the Panel application by clicking some button or something else.
  • This can be assets that are generated by a batch job.

The assets can be text files, csv files, json documents, xlsx documents, images and in prinicple any file type.

Solution(s)

  • Enable serving static assets from a static folder and its subfolders

Alternative Solution

Maybe this should not be a part of Panel. But if not a lot of users would still like to know how to obtain this functionality. So maybe some documentation describing one or more best practices and links to guides could be a solution.

Maybe it is as easy as linking to some documents on how to use the already running Tornado server?

This should include a description on how to use a reverse proxy or Tornado (?) to enable using a common url like

example.com
example.com/static

for the Panel app and the static assets served.

docs enhancement

Most helpful comment

I have been playing around with panel for a few weeks and I really like it; thanks for making such a nice framework available. The one thing I find missing most is being able to add static assets as described in this issue. So, a solution to this issue would be much appreciated!

All 5 comments

@philippjfr . Just some words on your thoughts and how you would do this would be very valuable. Maybe me or some other user could try it out in our own apps, return the learnings and then one day this could be a part of Panel.

This should be easy enough, I'd suggest having a configurable endpoint on pn.state.static_directory or similar.

Another user needs to be able to serve static assets with pn.serve and pn.show().

https://discourse.holoviz.org/t/adding-local-js-files-to-my-app/430/6

I have been playing around with panel for a few weeks and I really like it; thanks for making such a nice framework available. The one thing I find missing most is being able to add static assets as described in this issue. So, a solution to this issue would be much appreciated!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MarcSkovMadsen picture MarcSkovMadsen  路  3Comments

MarcSkovMadsen picture MarcSkovMadsen  路  3Comments

joelostblom picture joelostblom  路  3Comments

MarcSkovMadsen picture MarcSkovMadsen  路  3Comments

MarcSkovMadsen picture MarcSkovMadsen  路  5Comments