Вопрос

I have been reading this installation guide to install tinymce with django. First, it has not worked and second, it seems to be linked only with the admin account. Moreover other blogs about tinymce and django integration are also oriented towards admin account only.

I am basically making a blog application and I want to provide some of the basic features of tinymce and not the whole stuff. What should I do? Should I switch over to some other text editor.

Это было полезно?

Решение

i would suggest not doing anything at all on the server-side, include the JS files and use the normal JS-init for creating the widgets.

Другие советы

Try it:

class MyForm(forms.Form):

    def __init__(self, *args, **kwargs):
        super(MyForm, self).__init__(+args, **kwargs)
        self.fields['FIELD_NAME'].widget = TinyMCE()

As mentioned in the docs you have to specify the widget in your form class:

from tinymce.widgets import TinyMCE

class MyForm(ModelForm):
    html = forms.CharField(widget=TinyMCE())
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top