1

I am trying to use the last.fm API, and the artist search returns the following dictionary with an image:

{u'#text': u'http://userserve-ak.last.fm/serve/34/79694767.png', u'size': u'small'}

However, in my django template, I can't seem to access the value in "#text".

I'm guessing it has to do with the '#' in the name:

My code:

{% for artist in results %}
    <li>
    {{artist.name}}
    {{artist.image.0.#text}}
    </li>
{% endfor %}
corycorycory
  • 1,448
  • 2
  • 23
  • 42

1 Answers1

0

try this, # shouldnot be the problem:

{% for key, value in results.items %} 
 {{key}} - {{value}}
{% endfor %}
doniyor
  • 36,596
  • 57
  • 175
  • 260