如何设置django-ckeditor的占位属性



而使用django-ckeditor为我的网站,我想设置'占位符'属性的编辑器

我试过直接在settings.py中工作,像这样:

CKEDITOR_CONFIGS = {
'default': {
...
'extraPlugins': ','.join(['placeholder']),
'placeholder': 'blabla'
},
}
在my_app/forms.py:
widgets = {
'body': forms.Textarea(attrs={'placeholder': 'blabla'})
}

但它没有工作!我该怎么办?

使用editorplaceholder

CKEDITOR_CONFIGS = {
'default': {
...
'extraPlugins': ','.join(['placeholder']),
'editorplaceholder': 'blabla'
},
}

最新更新