How can I user chart js in django?

I need to user chart js
but appear this error
path(‘consumable/’, LineChartJSONView.as_view(), name=‘line_chart_json’),
NameError: name ‘LineChartJSONView’ is not defined

my cod
in view js
class LineChartJSONView(BaseLineChartView):
def get_labels(self):
“”“Return 7 labels for the x-axis.”""
return [“January”, “February”, “March”, “April”, “May”, “June”, “July”]

def get_providers(self):
    """Return names of datasets."""
    return ["Central", "Eastside", "Westside"]

def get_data(self):
    """Return 3 datasets to plot."""

    return [[75, 44, 92, 11, 44, 95, 35],
            [41, 92, 18, 3, 73, 87, 92],
            [87, 21, 94, 3, 90, 13, 65]]

line_chart = TemplateView.as_view(template_name=‘line_chart.html’)
line_chart_json = LineChartJSONView.as_view()

in urls
from django.urls import path
from django.conf.urls import url
from . import views

from random import randint
from django.views.generic import TemplateView
from chartjs.views.lines import BaseLineChartView

urlpatterns = [

path(‘conpre/’, views.conpre, name=‘conpre’),
path(‘item_cost/’,views.item_cost, name=‘item_cost’),
path(‘consumable/’,views.concost, name=‘consumable’),
path(‘consumable/’, LineChartJSONView.as_view(), name=‘line_chart_json’),

in base.html

        <script type="text/javascript">
        $.get('{% url "line_chart_json" %}', function(data) {
            var ctx = $("#myChart").get(0).getContext("2d");
            new Chart(ctx, {
                type: 'line', data: data

You used “from . import views”. Notice how to import a view function you had to use “views.my_view” format. Class based views are the same, views.LineCharJSONView.as_view() should fix your issue.