[Answer]-Django Admin tables not displaying correctly

1👍

Create a class that inherit admin.ModelAdmin, update the fields to be shown in the list_display tuple, and register TribeAdmin instead of Tribe. Do the same for the rest.

from django.contrib import admin
from . models import UserProfile, Tribe, Membership

# Register your models here.

class TribeAdmin(admin.ModelAdmin):
    list_display = ('field_1', 'field_2',)

admin.site.register(Tribe, TribeAdmin)
# admin.site.register(Membership)
# admin.site.register(UserProfile)

For all the available options, have a look at the documentation or an easy to understand beginner tutorial from the DjangoBook (please note its for an outdated Django Version, but fields works with Django 1.8)

With Django 1.8 you can use.

@admin.register(Tribe)
class TribeAdmin(admin.ModelAdmin):
    list_display = ('field',)

Leave a comment