Open bernd-wechner opened 1 year ago
It's not hard as it happens, but still would be nice to see it documented as it's a common use case IMHO.
In the app's top directory, just ad admin.py
if you don't have one or open it if you have one and add:
from django.contrib import admin
from django.contrib.flatpages.admin import FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
from django.db import models
from django_quill.widgets import QuillWidget
class FlatPageCustom(FlatPageAdmin):
formfield_overrides = {
models.TextField: {'widget': QuillWidget}
}
admin.site.unregister(FlatPage)
admin.site.register(FlatPage, FlatPageCustom)
The flatpages app is built into Django but lacks a decent editor:
https://docs.djangoproject.com/en/4.2/ref/contrib/flatpages/
I'd love to see some docs on how to attach the Quill editor to the django flatpages admin.