How To Use Django-summernote In Templates
I have setup django-summernote on my project and everything is great, it works very good on admin , but i want to use it on my templates. Note : in django-summernote documentation
Solution 1:
Firstly in your template dont forgate to add this:
{{ form.media }} <<<------ To load all js and css attached
In the document your models you must herit summernote widget. Example:
from django_summernote.widgets import SummernoteWidget, SummernoteInplaceWidget
classFormFromSomeModel(forms.ModelForm):
class Meta:
model = SomeModel
widgets = {
'foo': SummernoteWidget(),
'bar': SummernoteInplaceWidget(),
}
Post a Comment for "How To Use Django-summernote In Templates"