Skip to content
Advertisement

Can not print specifict values from an api response dictionnary (Dango)

i’m ne to Django and APIs and i’m struggling with this for days. Here’s my views.py file :

JavaScript

And here’s the index.html :

JavaScript

But when i try to do for example :

JavaScript

i get an error : (TemplateSyntaxError at / Could not parse the remainder: ‘[“height”]’ from ‘t[“height”]’)

Please help me and excuse me if it is a dumb question, i’m still a beginner in this framework

Advertisement

Answer

You can access the attributes using . in templates. Have a look at the accessing method calls documentation. You can try accessing using t.height.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement