Maj Osaka
Maj Osaka

Reputation: 11

django-facebook like and share button for contents. template example

I am trying to get django-facebook work with my website .

I have this model

class Photo(models.Model):
name = models.CharField(max_length=100)
photo=models.ImageField(upload_to=/upload)
catagory= models.CharField(max_length=100,choices=Choice_c)

the template is

{% for p in photos %}
{% thumbnail p.photo as im %}
{% endthumbnail %}
{%endfor%}

the view for photos is

def home(request):
photos=Photo.objects.all()
return render_to_response(‘home.html’, {‘photos’:photos,},context_instance=RequestContext(request))

Now my question is how can I have facebook “like” and “share” button for contents i.e photo using django-facebook . I have tried the facebook like code from facebook developers site but it chooses all the photos if I iterate and all photos get liked which is normal because I am iterating all of them.

Can you give a simple example how I can get individual likes for the photos by using django facebook.

Thanks in advance,

Upvotes: 1

Views: 254

Answers (0)

Related Questions