models.py
class The_image_model(models.Model):
image = models.ImageField(upload_to='images', blank=True)
...
views.py
def get_the_image(request):
get_images = The_image_model.objects.all()
...
return render(request, 'imageTemplate.html', {'get_images':get_images})
В imageTemplate. html:
{% load static %}
{% if get_images.images.url %}
<img class="img-fluid rounded mb-3 mb-md-0" src="{{ get_images.images.url}}"
alt="">
{% else %}
<img class="img-fluid rounded mb-3 mb-md-0" src="{% static 'image/empty-image.jpg' %}"
alt="">
{% endif %}