安装 django-tinymce:
$ pip install django-tinymce
添加 tinymce 到settings.py中的 INSTALLED_APPS 中
INSTALLED_APPS = (
...
'tinymce',
)
在urls.py 中配置 tinymce.urls
urlpatterns = [
...
url(r'^tinymce/', include('tinymce.urls')),
]
在你的model中
from django.db import models
from tinymce.models import HTMLField
class MyModel(models.Model):
...
content = HTMLField()
网友评论