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

发布于 2024-09-10 14:14:44 字数 1459 浏览 3 评论 0 原文

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

对我所缺少的有什么建议吗?我是否需要以某种方式将 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>

I used pip to install it, and followed the usage directions found here: http://django-tinymce.googlecode.com/svn/tags/release-1.5/docs/.build/html/usage.html under the section "The HTMLField model field type". I re-synced the db (not even sure that was needed), restarted apache2, and yet the text field is still just a textarea.

Any suggestions on what I am missing? Do I need to somehow link the django-tinymce templates into my media directory?

EDIT: Initialization code for the texarea, as requested:

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

他是夢罘是命 2024-09-17 14:14:44

您的配置:

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"
})

当我更改参数"元素到我页面上的一个文本区域的名称。我想你没有名为“id_Body”的 html 元素,对吧?如果是这样,请将参数更改为页面上 html 元素之一的名称。

Your config:

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"
})

works fine for me when i change the parameter "elements" to the name of one of my textareas on my page. I suppose you do not have a html element with the name "id_Body", right? If so, change the parameter to the name of one of your html-elements on your page.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文