I've got a Django model for a shirt. Here's the relevant part:
class Shirt(models.Model):
front_image = models.ImageField(upload_to="shirt_fronts")
class ShirtAdmin(admin.ModelAdmin):
pass
It works well in general; I can create new shirts in the admin, and upload pictures for them. I can then view those shirts in my shirt view, and they show up fine.
The only problem is in the admin itself. After I upload the image the image itself doesn't appear, only a link with the path to the image (eg. shirt_fronts/someImage.jpg
). If I then click the link I get taken to the wrong path for the image which (unsurprisingly) doesn't work.
So my question is, how do I fix that? Specifically, how can I get the link to go to the right place or (better yet) get that link to be the image or a thumbnail version of it?