Hello guys, I have my photos located on Flickr. I want to sync them between Flickr and my Django app using django-syncr. It's installed, Flickr section is visible in Admin site. I can sync photo data from Flickr to my local database. In a few words -- it works.
But, I don't understand how to get these data from my database using views.py and template file?I mean, how to make my Flickr's photos visible on my site?
I got something like this on my site:
* IMG_2467
* Morning fog on Halong bay
I used these files but get only title from all data and didn't anything else, including photos.
views.py
from django.shortcuts import render_to_response
from syncr.flickr.models import Photo
def index(request):
get_photo = Photo.objects.all()
return render_to_response('index.html', {'get_photo': get_photo})
index.html
<html>
<title>
Test page
</title>
<body>
{% if get_photo %}
<ul>
{% for photo in get_photo %}
<li>{{ photo }}</li>
{% endfor %}
</ul>
{% else %}
<p>No photos are available.</p>
{% endif %}
</body>
</html>