How to use Matplotlib in Django?

前端 未结 2 759
一整个雨季
一整个雨季 2020-12-01 04:29

From some examples from the Internet I made the test code below. It works!

... BUT if I reload the page, the pie will draw itself with the same image. Some parts ge

2条回答
  •  感动是毒
    2020-12-01 05:08

    1.save picture which created by matplotlib
    for example:plt.savefig('./app1/static/visualize.png') 2.use the picture in your html code for example:

    about django how to use static variable(like picture and js file) you can refer to django document

提交回复
热议问题