add: приложение blog (для страниц и постов)

This commit is contained in:
2026-01-25 12:10:27 +03:00
parent 846c066314
commit b967c374a5
8 changed files with 269 additions and 1 deletions

23
etpgrf_site/blog/admin.py Normal file
View File

@@ -0,0 +1,23 @@
from django.contrib import admin
from .models import Post
@admin.register(Post)
class PostAdmin(admin.ModelAdmin):
list_display = ('title', 'post_type', 'is_published', 'published_at')
list_filter = ('post_type', 'is_published', 'published_at')
search_fields = ('title', 'content', 'slug')
prepopulated_fields = {'slug': ('title',)}
date_hierarchy = 'published_at'
fieldsets = (
(None, {
'fields': ('title', 'slug', 'post_type', 'is_published', 'published_at')
}),
('Контент', {
'fields': ('image', 'excerpt', 'content')
}),
('SEO', {
'fields': ('seo_title', 'seo_description', 'seo_keywords'),
'classes': ('collapse',)
}),
)