title: Using related_name to call objects attributes in django templates
body: <p>I have 3 models. User, Post and Proof. Posts are added by a User to the website. When other users do what the post says. They upload 2 images to say they did the task. The template will show the 2 images they uploaded. I know I am making some mistake in the template calling the images. Does anyone know the correct way to use related_name to call for the images. FYI I am new to python and Django I am sorry if this question is too trivial or has wrong logic</p>
  
  <p>Proof/models.py  </p>
  
  <pre><code>User = get_user_model()
  
  class Proof(models.Model):
      user = models.ForeignKey(User, related_name='proofmade')
      post = models.ForeignKey(Post, related_name='postproofmade')
      made_at = models.DateTimeField(auto_now=True)
      image_of_task= models.ImageField()
      proof_you_made_it = models.ImageField()
      suggestions = models.TextField(max_length=1000)
  
      def __str__(self):
          return self.post.title
  </code></pre>
  
  <p>Templates</p>
  
  <pre><code>{% for user in post.made.all  %}
  &lt;div class="container"&gt;
     &lt;img src="{{ user.proofmade.image_of_task.url }}" height="150px"/&gt;
     &lt;img src="{{ user.proofmade.proof_you_made_it.url }}" height="150px"/&gt;
  &lt;/div&gt;
  {% endfor %}
  </code></pre>
  
  <p>Post/views.py</p>
  
  <pre><code>class PostDetail(SelectRelatedMixin, DetailView):
      model = Post
      select_related = ('user', 'group')
  
      def get_queryset(self):
          queryset = super().get_queryset()
          return queryset.filter(user__username__iexact=self.kwargs.get('username'))
  </code></pre>