``Images are rendering from other pages but nit rendering new page
views.py
def hotels(request):
mhtl = Hotel.objects.all()
context = {
'my_rms': mhtl,
}
return render(request,'affiliate/hotels.html', context)
type here
models.py
class Hotel(models.Model):
title = models.CharField(null=True, blank=True, max_length=100)
price = models.CharField(null=True, blank=True, max_length=100)
card_img = models.ImageField(null=True, blank=True, upload_to="images/")
def __str__(self):
return self.title`
The html page {% extends 'affiliate/base.html' %}
{% load static %}
{% block content %}
<h2>Find your next stay</h2>
<h3>HERE</h3>
<h5>--- WIDGET WIDGET WIDGET WIDGET ---</h5><hr>
<!--CARDS-->
{% for m in my_rms %}
<img src="{{ m.card_img }}">
<h5>{{m.title}}</h5>
<p>${{ m.price }}</p>
{% endfor %}
<hr>
{% endblock content %}
other datas are rendering except the image and the message from the terminal is:
[28/Mar/2023 10:17:48] "GET /hotels/images/ht7.jpg HTTP/1.1" 404 2991 Not Found: /hotels/images/ht7.jpg
I am trying to find a way to resolve this please
I tried a for lood to retrieve data from a specific model otherdatas are rendering only image is not.`