Reputation: 79
I have a web backend that provides me the info in a json format. For example:
,, What I'd like to know is, using Javascript, how can I taje advantage of such data to create the frontend? Typically, I would use return reder from Django, but in this case I am already returning the serialized data! Should I do a fetch from JavaScript? Please any help is very welcome.
Upvotes: 0
Views: 93
Reputation: 587
In your case, you have to use Django template language to show that data, you can access the data as context instead of making an extra request to Django in javascript.
context = {...} # include your data
return render(request, "example.html", context)
Upvotes: 1