回覆列表
  • 1 # 使用者1587133395689

    一、下載安裝

    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()

  • 中秋節和大豐收的關聯?
  • “新茶、中期茶”價格為何倒掛、如何鑑定老茶的真假?