Hello Plotly Community,
I am working on developing a Flask App using Plotly. Right now, when I run the app on my local computer the fig.write_html(“figure.html”, auto_open=True) will launch the new html page containing the Plotly figure; however, when I take the same code and run it with Docker no page is launched. I attempted to fix this by having
fig.write_html(os.getcwd() + "/templates/figure.html") and then have the @app.route
return render_template("figure.html") and that works… the first time. If you return to the homepage and run through the app again, the site will always launch the figure from the first run.
I attempted to fix this by having the app check for the figure.html file within the template fold and delete if present with each visit to the index but that doesn’t fix the problem either. I have also attempted to clear the cache for the site between runs and that doesn’t seem to work either.
Any advise on this topic would be greatly appreciated.