Why won't my images show?

{% load static %}
    {% for art in carousel %}
        <img src="{% static art.image %}" />
    {% endfor %}

from gallery.models import Art

def home(request):
    carousel = Art.objects.order_by("?")[:5]
    context = {
        'carousel': carousel,

    return render(request, 'home/index.html', context)


def upload_gallery_image(instance, filename):
    return f"gallery/gallery/img/{instance.title}/{filename}"

class Art(models.Model):
    title = models.CharField(max_length=100, unique=True)
    image = models.ImageField(upload_to=upload_gallery_image)
    short_description = models.CharField(max_length=100)
    description = models.TextField()
    for_sale = models.BooleanField()
    created_on = models.DateTimeField(auto_now_add=True)

    def __str__(self):
        return self.title

this same setup worked on another site, but refuses to work on this new site I’m building. The only difference here is where the images are being uploaded (and I’ve tried multiple setups for that), and I’m fetching 5 random images instead of specific images (I’ve tried specific images in different locations, and still 404). I’m at a loss.

This seems like confusion between media files and static files. User uploaded files should be handled by your media files. If your settings are mixed up between static and media this could lead to confusion. Assuming your media file settings are configured correctly, then you should be able to access the url of the file:

    {% for art in carousel %}
        <img src="{{ art.image.url }}" />
    {% endfor %}

this is my first time hearing about media files outside of one other post that didn’t actually say anything about them. Guess I have some research to do.