Need help showing image and information on page using tags

Hello. Can someone review this and let me know what I’m missing? I’ve specified the information in models.py, views.py, urls.py, settings.py, and plans.html. I have the folders in the directory showing the pictures. I have the admin page set up to upload the information and pictures. The info and pictures are shown and save into the database.

models.py

class Plans(models.Model):
    plan_number = models.CharField(max_length=50, blank=False, unique=True)
    slug = models.SlugField(max_length=50, unique=True)
    square_footage = models.CharField(max_length=50, blank=False)
    bedrooms = models.CharField(max_length=50, blank=False)
    bathrooms = models.CharField(max_length=50, blank=False)
    stories = models.CharField(max_length=50, blank=False)
    garage_stalls = models.CharField(max_length=50, blank=False)
    house_width = models.CharField(max_length=50, blank=False)
    house_depth = models.CharField(max_length=50, blank=False)
    description = models.TextField(max_length=500, blank=True)
    plan_price = models.DecimalField(max_digits=10, decimal_places=2)
    images = models.ImageField(upload_to='photos/plans')
    is_available = models.BooleanField(default=True)
    house_style = models.ForeignKey(HouseStyle, on_delete=models.CASCADE)
    created_date = models.DateTimeField(auto_now_add=True)
    modified_date = models.DateTimeField(auto_now=True)
    
    class Meta:
        verbose_name = "plan"
        verbose_name_plural = 'plans'

    def get_url(self):
        return reverse('plans', args=[self.house_style.slug, self.slug])

    def __str__(self):
        return self.plan_number

views.py

def plans_for_sale(request, house_style_slug=None):
    house_styles = None
    plans = None

    if house_style_slug != None:
        house_styles = get_object_or_404(HouseStyle, slug=house_style_slug)
        plans = Plans.objects.filter(category=house_styles, is_available=True)
        paginator = Paginator(plans, 1)
    else:
        plans = Plans.objects.all().filter(is_available=True).order_by('-plan_number')
        paginator = Paginator(plans, 12)
    page = request.GET.get('page')
    paged_plans = paginator.get_page(page)
    plan_count = plans.count()
    context = {
        'plans': paged_plans,
        'plan_count': plan_count,
    }
    return render(request, 'plans/plans.html', context)

def plan_number(request, house_style_slug, plan_slug):
    plan_card = Plans.objects.get(house_style__slug=house_style_slug, slug=plan_slug)
    
    plan_gallery = PlanGallery.objects.filter(product_id=plan_card.id)

    context = {
        'plan_card': plan_card,
        'plan_gallery': plan_gallery,
    }
    return render(request, 'plans/plan_number.html', context)

plans.html

<section class="bg-white text-black pb-5 pb-lg-6">
    <div class="container py-2">
      <ul class="list-unstyled row row-cols-1 row-cols-md-2 gy-4 mt-n6 mb-md-5 thumb">
        <li class="col">
          <div class="card bg-white border-0 img-rising">
            <img src="{{ plan_card.images.url }}" class="card-img-top img-fluid" alt="Clean design, better experience" width="640" height="400">
            <div class="card-body">
              <div class="small text-secondary text-uppercase mb-1">Plan # {{ plan_card.plan_number }}</div>
              <h2 class="card-title h4">
                <a href="{{ plan_card.images.url }}" class="link-body-emphasis stretched-link" target="mainImage" src="{{ plan_card.images.url }}" alt="Plan Card Image">{{ plan_card.house_style }}</a>
                {% for i in plan_gallery %}
                <a href="{{ i.image.url }}" target="mainImage">
                  <img src="{{ i.image.url }}" alt="Plan Card Image">
                </a>
                {% endfor %}
              </h2>
              <div class="small text-secondary mb-2">{{ plan_card.modified_date }}</div>
              <p class="card-text text-dark">This is a sample intro paragraph and can be used to introduce readers to your article.</p>
            </div>
          </div>
        </li>
      </ul>

Your code posted here is very difficult to read.

Enclose the entire block of code between lines of three
backtick - ` characters - not each line. Also, do not prefix each line with >.

If you fix your post, this will make it more readable and people will be more likely to respond.

Also, it would be helpful if you describe exactly what is not happening that you’re expecting to see happen. Let us know what you’re trying to do and what you’re getting. (The screenshot doesn’t really explain anything.)

Thanks for the information. I’ll remember that for next time. I was trying to display the image and information stored in the database using the dynamic context tags. I finally figured it out.