[SOLVED]Show data from API on Django tempalte

Vicente G. Reyes - Apr 15 '20 - - Dev Community

This is the continuation of my question yesterday and I'm now trying to show the fetched data on the django template.

Can anyone help me?

2

I'm trying to show the fetched data on an API to the Django template.

Here's what I've tried on home.html

<h1>Title: {{data.title}}</h1>

Here's my views.py which gets the data from services.py

class IndexData(TemplateView):
    def get(self, request):
        article_data = services.get_data()
        return render(request, 'pages/home.html', article_data)

Here's the services.py

def get_data(title, url, description,
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player