Hi,
Guys earlier have provided useful links for consuming APIs. Just want to emphasize some concepts between server-side and client-side codes.
A django template is rendered into a page on the server side. That means, the server does the work and prepares the html content before sending it to the browser. In theory, you can call APIs when rendering the templates on the server side, but it's almost never a good idea. APIs are designed to be consumed by clients. The django templates should contain the relevant javascripts (using ajax). These javascripts are not executed when the server renders the templates. They are sent as they are to the client, and are executed automatically by the browser. If the javascript calls API, the browser will come back to your server (this time, to the rest api endpoints, instead of the template rendering endpoints) and consume your API.
Hope it helps.
Best
Zheng