Skip to content

Commit 5a576fc

Browse files
author
yangxg
committed
Step7: publish posts using django admin
1 parent 144494e commit 5a576fc

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

blog/admin.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
from django.contrib import admin
2+
from .models import Post, Category, Tag
23

3-
# Register your models here.
4+
5+
class PostAdmin(admin.ModelAdmin):
6+
list_display = ['title', 'created_time', 'modified_time', 'category', 'author']
7+
8+
9+
admin.site.register(Post, PostAdmin)
10+
admin.site.register(Category)
11+
admin.site.register(Tag)

0 commit comments

Comments
 (0)