[Chartjs]-Django 'LineChart' object has no attribute 'get'

0👍

You should use the view some_view in your URL pattern, not the class LineChart.

url(r'^polls/bubble/$', views.some_view, name='bubble'),

Also, check that the indentation for some_view is correct. It might just be a mistake in your question instead of your actual code, but you currently have some_view as a method of the LineChart class. It should be:

class LineChart(Chart):
    chart_type = 'line'
    responsive = False
    ...

def some_view(request):
    render(request, 'polls/chart.html', {
    'line_chart': LineChart(),
})

Leave a comment