How do I render a plot to the view in flask
?
devices.py:
@devices_blueprint.route('/devices/test/')
def test():
y = [1,2,3,4,5]
x = [0,2,1,3,4]
plot_url = plt.plot(x,y)
return render_template('devices/test.html', plot_url=plot_url)
test.html
<div class="container">
<h2>Image</h2>
<img src= {{ resized_img_src('plot_url') }} class="img-rounded" alt="aqui" width="304" height="236">
</div>
Im trying to use seaborn
with this, but even with matplolib
I couldn’t get any result.
Note: I don’t want to save image and load it after.