I read this useful Flask + Bokeh AjaxDataSource and I was able to generate the sample plot. I tried to modify the code in such a way to have the html file defined in the templates folder and let the flask to render_template the html file by passing the div and script elements as below:
script, div = components(fig)
return render_template('testajax.html', script = script, div = div)
and my HTML file is as follows:
{% extends "template.html" %}
{% block content %}
<div class="container">
<div>
{{ script | safe}}
{{ div | safe}}
</div>
</div>
{% endblock %}
With the above changes, I will get these errors:
WindowsError: [Error 32] The process cannot access the file because it is being used by another process.
I think I do not have enough knowledge about the INLINE.render_js().
What is the issue and how can I resolve that? I appreciate your help.