alanjameschapman / whiteboard

django blog for teachers and students
0 stars 1 forks source link

USER STORY: use Rich Text Formatting #15

Closed alanjameschapman closed 8 months ago

alanjameschapman commented 8 months ago

As a teacher I can use Rich Text Formatting so that I can create engaging content.

Acceptance Criteria

Tasks

alanjameschapman commented 8 months ago

Update whiteboard/urls.py:

urlpatterns = [
    ...
    path("summernote/", include("django_summernote.urls")),
    ...
]

Add PostAdmin class with decorator (and removing existing registration) to edblog/admin.py:

...
from django_summernote.admin import SummernoteModelAdmin

@admin.register(Post)
class PostAdmin(SummernoteModelAdmin):

    list_display = ('title', 'slug', 'status')
    search_fields = ['title']
    list_filter = ('status',)
    prepopulated_fields = {'slug': ('title',)}
    summernote_fields = ('content',)

# Register your models here.
~~admin.site.register(Post)~~
admin.site.register(Comment)
Before After
Image Image