1👍
Your Django service is set to return an HTML response instead of a JSON payload. Add the following settings to your settings.py
file and theoretically your application should be up and running.
REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': (
'rest_framework.renderers.JSONRenderer',
),
}
`
0👍
I followed a similar tutorial on YouTube. I am a total newbie and came across this question, when I am trying to figure out how this thing works.
From what I understand
<div class="col-sm-12" url-endpoint="'{% url "nutrition:chart" %}">
I think something is wrong with the Url endpoint, why is it pointing at ChartView() when you are inside ChartData().
Also, your url patterns don’t quiet align with your charts.html end point. Again, I am a total newbie, I am only talking about different patterns from what I saw in the tutorial. I am referring to
“CodingEntrepreneurs -channel : Django + Chart.js // Learn to intergrate Chart.js with Django -video”