0

I'm currently using python-twitter for a personal project, I'm able to retrieve all the filtered data I need (mentions to a set of users) but I need to extract the DisplayURL from the media object.

I do a:

{% for tweet in tweets %}
   {{ tweet.media|safe }}
{% endfor %}

Which results in:

[Media(ID=802077234601279488, Type=photo, DisplayURL='pic.twitter.com/QDoSBaQLxv')]

How can I actually get the DisplayURL on it? I tried with:

{{ tweet.media.DisplayURL }}
{{ tweet.media[Media].DisplayURL }}
{{ tweet.media.Media.DisplayURL }}

But none of those work.

Thanks

1 Answers1

0

Found out the solution,

Actually all the values returned from tweet in python-twitter are Lists so I had to create a custon template-tag to filter it and return media_url.