Para instalar TinyMCE
pip install django-tinymce
Primeiro passo configurar o settings.py
INSTALLED_APPS = (
'tinymce',
)
# editor
TINYMCE_SPELLCHECKER = False
TINYMCE_COMPRESSOR = False
TINYMCE_DEFAULT_CONFIG = {
'plugins': "paste",
'paste_text_sticky': True,
'paste_text_sticky_default': True,
'theme': "advanced",
'theme_advanced_buttons1': "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,|,link,unlink,anchor,|,table,removeformat,code",
'theme_advanced_buttons2': "",
'theme_advanced_buttons3': "",
'theme_advanced_buttons4': "",
'theme_advanced_toolbar_location': "top",
'theme_advanced_toolbar_align': "left",
'theme_advanced_statusbar_location': "bottom",
'theme_advanced_resizing': True,
}
models.py
# -*- coding: utf-8 -*-
from django.db import models
from tinymce import models as tinymce_models
class Artigo(models.Model):
texto = tinymce_models.HTMLField( null=True, blank=True )
abraço
AVISO DE SEGURANÇA (DYOR): Todo o conteúdo do wiskton.xyz tem caráter estritamente educativo e informativo. Criptoativos envolvem volatilidade e riscos cibernéticos. Jamais compartilhe sua seed phrase ou chaves privadas com terceiros.