看了很多选项来使用django来渲染图表我认为graphos可能是最好的选择,但是当试图运行它使用那里非常基本的例子我得到错误的模板不存在 异常类型:TemplateDoesNotExist 异常值:graphos/flot.htmldjango graph with graphos说模板不存在
我用非常基本的代码从他们的文档这里https://agiliq.com/docs/django-graphos/flot.html:
views.py
def index(request):
queryset = Pockets.objects.all()
print "query set is ",queryset
data_source = ModelDataSource(queryset,
fields=['pocket_name', 'sum_pocket'])
chart = flot.LineChart(data_source)
print "chart is ",chart
context_dict.update({'chart': chart})
return render_to_response('a/index.html', context_dict, context)
在我的index.html我使用
<div>
<!--for graph stuff-->
{{ chart.as_html }}
</div>
但仍然得到错误TemplateDoesNotExist/A/ 异常类型:TemplateDoesNotExist 异常值:graphos/flot.html
想不出搞清楚什么能问题,文件没有说明缺少什么。 任何人都可以帮忙吗?