在我的 form.py 中,我有以下代码
from django import forms
import autocomplete_light
from .models import Note
from django_summernote.widgets import SummernoteWidget, SummernoteInplaceWidget
class NoteForm(forms.ModelForm):
title = forms.CharField(max_length=120)
note = forms.CharField(widget=SummernoteWidget( attrs={'width': '50%', 'height': '400px'} ), label="Description", required=False )
class Meta:
model = Note
exclude = ["slug", "author"]
但在我的模板中,summernote 没有正确显示,它只显示工具栏。
如果我随后将 SummernoteWidget 替换为 SummernoteInplaceWidget,则表单将完全消失。IE
note = forms.CharField(widget=SummernoteInplaceWidget( attrs={'width': '50%', 'height': '400px'} ), label="Description", required=False )