I'm trying to display an uploaded image in "Change" page in Django Admin but I cannot do it as shown below:
This is my code below:
# "models.py"
from django.db import models
class Product(models.Model):
name = models.CharField(max_length=50)
price = models.DecimalField(decimal_places=2, max_digits=5)
image = models.ImageField()
def __str__(self):
return self.name
# "admin.py"
from django.contrib import admin
from .models import Product
@admin.register(Product)
class ProductAdmin(admin.ModelAdmin):
pass
So, how can I display an uploaded image in "Change" page in Django Admin?