django model的设计
1 设计blog的显示界面: 在blog/admin.py修改
from django.contrib import admin from blog.models import BlogPost # Register your models here. class blogAdmin(admin.ModelAdmin): list_display = ['title','body','timestamp'] # display fields search_fields = ['title'] list_filter = ['timestamp'] admin.site.register(BlogPost,blogAdmin)
2 界面显示如下: