我创建了一个博客并安装了 django-tinymce 1.5.2。但是当按照上述文档进行配置时,我没有在管理面板中输入文本的字段。
我的模型
class Post(models.Model):
DRAFT = "D"
PUBLISHED = "P"
POST_STATUS = (
(DRAFT, "Draft"),
(PUBLISHED, "Published"),
)
title = models.CharField(max_length=120)
text = HTMLField()
status = models.CharField(choices=POST_STATUS, default=DRAFT, max_length=10)
creation_date = models.DateTimeField(auto_now_add=True)
modification_date = models.DateTimeField(auto_now=True)
设置.py
INSTALLED_APPS = (
....
'suit',
'tinymce',
....
)
TINYMCE_JS_URL = os.path.join(STATIC_URL, 'tinymce/js/tinymce/tinymce.min.js')
TINYMCE_JS_ROOT = '/static/js/tiny_mce'
TINYMCE_DEFAULT_CONFIG = {
'plugins': "table,spellchecker,paste,searchreplace,print,textcolor",
'theme': "modern",
'cleanup_on_startup': True,
'custom_undo_redo_levels': 10,
}
TINYMCE_SPELLCHECKER = True
TINYMCE_COMPRESSOR = True