I’m trying to get the plots made by my stocks.py file onto a Flask app, and I’m having a bit of trouble getting this to work. What I want to do is create a file stocks.html that contains the typical Bokeh file output, and render that in Flask. To do so, Flask looks into the /templates/ subdirectory and uses the files that are in there. However, whenever I try and open stocks.html in a directory that does not contain stocks.py, none of the plots appear. So, I can’t get Flask to render a working stocks.html. Why does this happen?
Additionally, I have a few questions:
How do I make it so that I don’t need to run stocks.py and recreate stocks.html before pushing to git?
Is there a way to get only the plots from the output rather than the entire .html file?
Does Bokeh have any support for Flask, or does it need to be run separately (by creating the .html first)? If it does have support, how do I integrate it with my original Flask app?