看了很多選項來使用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
想不出搞清楚什麼能問題,文件沒有說明缺少什麼。 任何人都可以幫忙嗎?