需要修改app的admin.py文件
#修改index的admin.py文件
from django.contrib import admin
from index.models import *
# Register your models here
class ProductAdmin(admin.ModelAdmin):
list_display = ['id', 'name', 'weight', 'size', 'type' ]
admin.site.register(Product, ProductAdmin)
#修改网页title和站点header。
admin.site.site_title = "MyDjango后台管理"
admin.site.site_header = "MyDjango"
转载于:https://www.cnblogs.com/eagleow/p/10735767.html