Jupyter HTML output displayed in IFrame downloads instead of displaying

I’m putting together a simple blog app that will display Jupyter Notebooks as blog posts. I’m trying using an IFrame component to display the exported HTML (from NBconvert). The HTML is stored in a data table and I’m setting the URL property as such (data table view is allowed from client):

article = app_tables.articles.get(slug=slug)
self.i_frame_1.url = article['article_html'].url

When I view the page the HTML file is downloaded instead of being displayed. Any idea why? Here is a clone link with the dependencies:

https://anvil.works/build#clone:TG4HCGBQAFH2DNXW=GL6KSF2YWN4NFNVP7HWCVMPQ

The URL’s from data table media objects default to download as opposed to open in the browser. You can change this behaviour by calling article['article_html'].get_url(False).

For more detail please see this post from Meredydd.

2 Likes

Was away on holiday, belated thanks!

1 Like