I am refactoring my Panel application into a Flask WebApp (The app grew outside the scope of a single page webapp).
I was hoping to continue using Panel apps on different Routes. I have seen in the documentation how to do this: https://holoviews.org/user_guide/Deploying_Bokeh_Apps.html (Should this be inside the holoviews docs and not panel??)
- Run panel application (
- Pull session inside flask app with corresponding panel port
I have two questions:
Is it possible to parameterize the panel apps? (Say I have a bunch of datasets inside a db, and endpoints corresponding to the dataset
/<int:id>/panel_appcould I pull the data in automatically without using a “generic app” and choosing the dataset again?
I haven’t tried (yet) and maybe more a flask question but is there a way to start the panel app (maybe in a subprocess) when the endpoint is hit and kill it when left?
On a side note if it is useful for anyone I got dynamic holoviews working:
@app.route('/<int:_id>/map') @login_required def map(_id): ds = load_file(_id) lon, lat = get_lon_lat_names(_id) plot = ds.hvplot(x=lon, y=lat).opts(responsive=True) plot = hv.render(plot, backend='bokeh') html = file_html(plot, CDN) soup = BeautifulSoup(html, "html.parser") return render_template('app/map.html', head=soup.head, body=soup.body, data_file_id=_id)