My template:
{% block content %}
{% if next_url %}
{% endif %}
{% if photos %}
{% for photo in photos %}
{% 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).