刚刚安装了django-tinymce,但HTMLField没有显示在管理视图中

时间:2010-07-20 11:05:58

标签: django django-admin tinymce django-tinymce

我使用pip进行安装,并按照此处的使用说明进行操作:http://django-tinymce.googlecode.com/svn/tags/release-1.5/docs/.build/html/usage.html在“HTMLField模型字段类型”部分下。我重新同步数据库(甚至不确定是否需要),重新启动apache2,然而文本字段仍然只是一个textarea。

有关我遗失的任何建议吗?我是否需要以某种方式将django-tinymce模板链接到我的媒体目录?

编辑:texarea的初始化代码,按要求:

   <script type="text/javascript">tinyMCE.init({"relative_urls": false, "spellchecker_languages": "Arabic=ar,Bulgarian=bg,Bengali=bn,Bosnian=bs,Catalan=ca,Czech=cs,Welsh=cy,Danish=da,German=de,Greek=el,+English / British English=en,Spanish / Argentinean 
Spanish=es,Estonian=et,Basque=eu,Persian=fa,Finnish=fi,French=fr,Frisian=fy,Irish=ga,Galician=gl,Hebrew=he,Hindi=hi,Croatian=hr,Hungarian=hu,Indonesian=id,Icelandic=is,Italian=it,Japanese=ja,Georgian=ka,Khmer=km,Kannada=kn,Korean=ko,Lithuanian=lt,Latvian=lv,Macedonian=mk,Mongolian=mn,Dutch=nl,Norwegian=no,Norwegian Bokmal=nb,Norwegian Nynorsk=nn,Polish=pl,Portuguese / Brazilian Portuguese=pt,Romanian=ro,Russian=ru,Slovak=sk,Slovenian=sl,Albanian=sq,Serbian / Serbian Latin=sr,Swedish=sv,Tamil=ta,Telugu=te,Thai=th,Turkish=tr,Ukrainian=uk,Vietnamese=vi,Simplified Chinese / Traditional Chinese=zh", "elements": "id_Body", "language": "en", "directionality": "ltr", "theme": "simple", "strict_loading_mode": 1, "mode": "exact"})</script>

1 个答案:

答案 0 :(得分:1)

您的配置

tinyMCE.init({"relative_urls": false,
          "spellchecker_languages": "Arabic=ar,Bulgarian=bg,Bengali=bn,Bosnian=bs,Catalan=ca,Czech=cs,Welsh=cy,Danish=da,German=de,Greek=el,+English / British English=en,Spanish / Argentinean Spanish=es,Estonian=et,Basque=eu,Persian=fa,Finnish=fi,French=fr,Frisian=fy,Irish=ga,Galician=gl,Hebrew=he,Hindi=hi,Croatian=hr,Hungarian=hu,Indonesian=id,Icelandic=is,Italian=it,Japanese=ja,Georgian=ka,Khmer=km,Kannada=kn,Korean=ko,Lithuanian=lt,Latvian=lv,Macedonian=mk,Mongolian=mn,Dutch=nl,Norwegian=no,Norwegian Bokmal=nb,Norwegian Nynorsk=nn,Polish=pl,Portuguese / Brazilian Portuguese=pt,Romanian=ro,Russian=ru,Slovak=sk,Slovenian=sl,Albanian=sq,Serbian / Serbian Latin=sr,Swedish=sv,Tamil=ta,Telugu=te,Thai=th,Turkish=tr,Ukrainian=uk,Vietnamese=vi,Simplified Chinese / Traditional Chinese=zh",
          "elements": "id_Body",
          "language": "en",
          "directionality": "ltr",
          "theme": "simple",
          "strict_loading_mode": 1,
          "mode": "exact"
})
当我将参数elements更改为我页面上某个textareas的名称时,

可以正常使用。我想你没有一个名为“id_Body”的html元素,对吧?如果是这样,请将参数更改为页面上某个html元素的名称。