How can I add Bootstrap class or css in the Ckeditor at Django for responsive?

130 Views Asked by At

I've taken RichTextField from CKEditor. But problem is, that the field is not responsive. It shows perfectly on the big screen but not on the mobile screen or the small screen. How can I responsive this for the mobile screen or the small screen?

forms.py:

from ckeditor.fields import RichTextField

class update_product_info(forms.ModelForm):
    product_desc = RichTextField()

    class Meta:
        model = Products
        fields = ('product_desc')
        
        labels = {
            'product_desc':'Description'
        }

        widgets = {
            'product_desc':forms.Textarea()
    }

settings.py:

CKEDITOR_CONFIGS = {
    'default': {
        'toolbar':'Custom',

        'FontSize':20,
        'toolbar_Custom': [
            ['Undo','Redo'],
            ['Styles','Font','FontSize','Bold','Underline','Italic','HorizontalRule','Flash'],
            ['TextColor','BGColor'],
            ['Table']
        ]
    }
}

Template:

<form action="" method="POST" class="needs-validation" style="font-size: 13px;" novalidate="" autocomplete="off" enctype="multipart/form-data">
 {% csrf_token %}
 {{form.media}}
 {{form.as_p}}
  
     <div class="d-flex align-items-center">
         <button type="submit" class="btn btn-outline-dark ms-auto" value="Update" style="font-size: 13px;">Add</button>
      </div>
 </form>
0

There are 0 best solutions below