title: How do I access the linked table in django
body: <p>My blog has multiple recipes in each blog post. And the recipes are used more than once across all blog posts.</p>
  <p>I am trying to create a page where I can display all the recipes in a grid. Once the visitor clicks on a recipe I want it linked to the first blog post in the database that includes that specific recipe. Cause I have html pages for every blog post but not for every recipe.</p>
  <p>I cannot wrap my head around how this will be structured and accomplished. Should I redesign the models or is there a way to do this with django templates? Any help will be appreciated!</p>
  <p><code>models.py</code></p>
  <pre><code>class Posts(models.Model):
      title = models.CharField(max_length=155)
      summary = models.TextField(blank=True, null=True)
      slug = models.SlugField(unique=True, max_length=155)
      
  
  class PostRecipes(models.Model):
      post = models.ForeignKey('Posts', models.DO_NOTHING)
      recipe = models.ForeignKey('Recipes', models.DO_NOTHING)
  
  
  class Recipes(models.Model):
      title = models.CharField(max_length=155)
      summary = models.TextField(blank=True, null=True)
      content = models.TextField(blank=True, null=True)
  </code></pre>
  <p><code>views.py</code></p>
  <pre><code>def allrecipes(request):
      recipes = Recipes.objects.all()
  
      context = {
          'recipes': recipes,
      }
      return render(request, &quot;All-recipes.html&quot;, context)
  </code></pre>
  <p><code>All-recipes.html</code></p>
  <pre><code>{% for item in recipes %}
    &lt;a href=&quot;{{ STATIC_URL }}/{{ item.slug }}&quot;&gt;{{ item.title }}&lt;/a&gt;
  {% endfor %}
  </code></pre>