1from django.utils.html import format_html
2
3@admin.register(Model1)
4class Model1Admin(admin.ModelAdmin):
5
6 def image_tag(self, obj):
7 return format_html('<img src="{}" />'.format(obj.image.url))
8
9 image_tag.short_description = 'Image'
10
11 list_display = ['image_tag',]
12
1in main URL:
2
3from django.conf import settings
4from django.conf.urls.static import static
5
6urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)