title: How to generate a unique div id for django objects displayed in template
body: <p>I am working on a Django project. I have a template which displays all the available posts. Users can like a post. Everything is working fine. But I am facing a problem. Since I am using ajax to change the status of the like button when a user clicks on it, I noticed that all the like buttons of the displayed posts object are affected, when a user clicks on the like button of one of the displayed posts. I want changes to occur just on the like button the user has clicked. Not all the like buttons of the displayed post object</p>
  
  <p>Example of my HTML template looks something of this sort.</p>
  
  <pre><code>{% for post in allpost %} &lt;!--for loop to get all post objects in data base--&gt;
  {{post.tittle}}
  {{post.content}}
  {{post.type}}
  
  &lt;!-- like button  for users to be able to like post they fine interesting--&gt;
  &lt;a  href="" data-href="{% url 'post:api_like' slug=post.slug %}"&gt;
  &lt;button id="like"&gt;like&lt;/button&gt;&lt;/a&gt;
  {% endfor %}
  </code></pre>
  
  <p>So you can see my like button id is not dynamic, which is one of the reasons I am facing this problem. How can I go about generating a dynamic button id for each like button in the for loop post? </p>
  
  <p>Please Help me out </p>