После добавления строчки fields появилась ошибка
admin.py
class NewsAdmin(admin.ModelAdmin):
list_display = ('id', 'title', 'category', 'pub_date', 'is_published', 'get_photo')
list_display_links = ('id', 'title')
search_fields = ('id', 'title', 'content')
list_editable = ('is_published', 'category')
list_filter = ('pub_date','is_published',)
fields = ('id', 'title', 'content', 'category', 'pub_date', 'is_published','photo', 'get_photo')
readonly_fields = ('get_photo', 'pub_date')
def get_photo(self, obj):
if obj.photo:
return mark_safe(f'<img src="{obj.photo.url}" width="75px">')