old_contents: from django.contrib import admin
  
  from .models import Gallery, GalleryImage
  
  
  class GalleryImageInline(admin.StackedInline):
      model = GalleryImage
  
  
  class GalleryAdmin(admin.ModelAdmin):
      model = Gallery
      inlines = [GalleryImageInline, ]
  
  
  admin.site.register(Gallery, GalleryAdmin)
  
new_contents: from django.contrib import admin
  
  from .models import Gallery, GalleryImage
  
  
  class GalleryImageInline(admin.TabularInline):
      model = GalleryImage
      extra = 1
  
  
  class GalleryAdmin(admin.ModelAdmin):
      model = Gallery
      inlines = [GalleryImageInline, ]
  
  
  admin.site.register(Gallery, GalleryAdmin)
  
subject: Adjust gallery image formset in admin app