Search code examples
djangodjango-tinymce

change django-tinymce content css for various object


How can I change content_css option in django-tinymce for various objects? I mean that when I use tinymce for model1 then content_css is model1.css and when for model2 then model2.css. I use


Solution

  • I found out that I can pass extra arguments for tiny_mce in Meta class:

    class Meta:
            model = MyModel
            widgets = {
                'field_name': TinyMCE(mce_attrs={'content_css': "style.css"}),
            }