一、下載安裝
python setup.py install
二、
1.將tinymce/static/tiny_mce資料夾放到your_project/static目錄下;
2.將tinymce資料夾放到your_project目錄下
三、在urls.py檔案中加入:
url(r"^tinymce/",include("tinymce.urls")),
四、在settings.py檔案中加入:
INSTALLED_APPS = (
"tinymce",
)
五、在settings.py檔案中加入:
TINYMCE_JS_URL=MEDIA_URL+"/static/tiny_mce/tiny_mce_src.js"
TINYMCE_JS_ROOT=MEDIA_ROOT+"/static/tiny_mce/"
六、在settings.py檔案中加入:
TINYMCE_DEFAULT_CONFIG = {
"theme": "advanced",
"theme_advanced_toolbar_location" : "top",
"theme_advanced_toolbar_align" : "left",
‘width’: 600,
‘height’: 400,
}
七、修改models.py檔案
from your_project.tinymce import models as tinymce_models
class Post(models.Model):
body=tinymce_models.HTMLField()
一、下載安裝
python setup.py install
二、
1.將tinymce/static/tiny_mce資料夾放到your_project/static目錄下;
2.將tinymce資料夾放到your_project目錄下
三、在urls.py檔案中加入:
url(r"^tinymce/",include("tinymce.urls")),
四、在settings.py檔案中加入:
INSTALLED_APPS = (
"tinymce",
)
五、在settings.py檔案中加入:
TINYMCE_JS_URL=MEDIA_URL+"/static/tiny_mce/tiny_mce_src.js"
TINYMCE_JS_ROOT=MEDIA_ROOT+"/static/tiny_mce/"
六、在settings.py檔案中加入:
TINYMCE_DEFAULT_CONFIG = {
"theme": "advanced",
"theme_advanced_toolbar_location" : "top",
"theme_advanced_toolbar_align" : "left",
‘width’: 600,
‘height’: 400,
}
七、修改models.py檔案
from your_project.tinymce import models as tinymce_models
class Post(models.Model):
body=tinymce_models.HTMLField()