title: Show posts when clicking on a tag (django)
body: <p>I am new to django and I am facing a problem I can't solve.</p>
  <p>I'm making a blog and I want to be able to click on a tag and go to  a new page which will have all posts with this tag. I already made a page which has the selected tag as a slug in the url, but I don't know how to show all the posts with that tag on this page.
  My models page:</p>
  <pre><code>class Tag(models.Model):
      caption = models.CharField(max_length=30)
      tag_slug = models.SlugField(unique=True, db_index=True, null=True)
  
  class Post(models.Model):
      title = models.CharField(max_length = 150)
      image_name = models.CharField(max_length=100)
      slug = models.SlugField(unique=True, db_index=True)
      tags = models.ManyToManyField(Tag)
  </code></pre>
  <p>My urls page:</p>
  <pre><code>urlpatterns = [
      path(&quot;&quot;, views.starting_page, name = &quot;starting-page&quot;),
      path(&quot;posts&quot;, views.posts, name = &quot;posts-page&quot;),
      path(&quot;posts/&lt;slug:slug&gt;&quot;, views.post_detail, name = &quot;posts-detail-page&quot;),
      path(&quot;posts/tag/&lt;slug:tags&gt;&quot;, views.post_tag, name = &quot;post-tag-page&quot;), 
     
  ]
  </code></pre>
  <p>and the function I created to render this:</p>
  <pre><code>  def post_tag (request, tags):
          identified_tag = get_object_or_404(Tag, tag_slug=tags)
          return render (request, &quot;blog/post-tags.html&quot;)
  </code></pre>
  <p>I use this function to render the page but I do't know how to select (and render) all posts (their images to be precise) which have a specific tag.</p>