My template:
{% block content %}
{% if next_url %}
{% endif %}
{% if photos %}
{% for photo in photos %}
{{ photo.user.username }}
[ T | M | L | O ]
{{ photo.l }}
{{ photo.created_time }} Map
{% endfor %}
{% else%}
empty ;(
{% endif %}
{% endblock %}
{% block pagination %}
{% if next_url %}
{% endif %}
{% endblock %}
And a have a view, that gets 'photos' and 'next_url' via external api and makes some changes:
def tag(request, tag):
api = InstagramAPI(client_id='', client_secret='')
tag_m, next = api.tag_recent_media(tag_name=tag.encode('utf-8'), count=16)
photos = photos + tag_m
if next != None:
....
next_url = ....
....
for photo in photos:
....
return render_to_response(
'tag.html',
{'photos': photos, 'next_url': next_url},
context_instance=RequestContext(request))
How can i display this data dynamically via ajax? I want to append results from next_url to current page (load more function).
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)