我完全按照这个链接中提到的做了一切:
https://django-matplotlib.readthedocs.io/en/latest/
当我转到管理页面并点击Add My Model。我得到了错误
ImportError at /admin/my_app/mymodel/add/
Couldn't locate 'figures.py' in the app directory.按照文档中的建议,figures.py与models.py位于相同的目录中。
如果有人试图以这种方式在django中包含matplotlib,我想知道我做错了什么。
这里是初学者。请耐心等待。
发布于 2019-11-09 17:53:27
我找到了解决方案。我还需要在django的active virtualenv中安装matplotlib,而不仅仅是通过普通的Shell。因此,我激活了我的虚拟端,然后使用pip install matplotlib安装了matplotlib。现在如图所示,正如文档所示。
https://stackoverflow.com/questions/58778019
复制相似问题