title: how to display foreignkey image in django
body: <p>Here is the problem, I'm a bit lost with foreignkey, i've seen a lot of post and i don't understand everything.<br>
  I have a item table: <br></p>
  
  <pre><code>class Item(models.Model):
      title = models.CharField(max_length=150)
      slug = models.SlugField(max_length=100)
      price = models.IntegerField()
      stock = models.IntegerField()
      description = models.TextField()
      image = models.ImageField(upload_to=item_file_name)
  </code></pre>
  
  <p>There is an image wich is the principal. On my index when I list all my item I want to see the image of each item. But when I click on the item I want to see all of the image of this item (in another view). So I've done this.</p>
  
  <pre><code>class ImageOfItem(models.Model):
      picture = models.ImageField(upload_to=item_file_name_for_image)
      item = models.ForeignKey('Item')
  </code></pre>
  
  <p>I don't know if it's good but it's working. I can add an item with a picture on the admin panel. And then I can add an image and attach it to the item.(it works, the best way would be to be able to upload all the image when creating the item but I prefer to start easy).<br>
  So know everything is save as I want. But I don't know how to display all the images.
   My view looks like this:</p>
  
  <pre><code>def view_item(request, id, slug):
      item = get_object_or_404(Item, id=id)
      return render(request, 'ecommerce/view_item.html', locals())
  </code></pre>
  
  <p>I don't know if I have to get images too or if django already done it. and there is no var_dump so no way to know if it's in my variable <strong>item</strong></p>
  
  <p>my template:</p>
  
  <pre><code>{{item.title}}
  {{item.description}}&lt;br&gt;
  {{item.price}}&lt;br&gt;
  {{item.stock}}&lt;br&gt;
  
  &lt;img src="{{ item.image.url }}"&gt;&lt;br&gt; //principal image it works !!
  {% for img in item.ImageOfItem %}
      &lt;img src="{{ img.picture.url }}"&gt;&lt;br&gt; //**all the image I want to display too (but don't know how)**
  {% endfor %}
  </code></pre>
  
  <p><strong>all the image I want to display too (but don't know how)</strong></p>