django-tinymce 无法正确显示小部件

发布于 2024-10-06 11:43:11 字数 572 浏览 0 评论 0原文

我正在尝试使用 django-tinymce (http://http://django-tinymce.googlecode.com/ )应用程序在 django 管理中显示所见即所得编辑器。

我下载并安装了它,下载了tinymce本身并将其放入/js/tiny_mce中,没有更改settings.py中的任何内容,并向我的模型添加了一个HTMLField,如下所示:

class MyModel(models.Model):
  text  = tinymce.models.HTMLField()
  ...

当我通过django-admin添加新条目时, tinyMCE 就在那里,但一切都被砍掉了——没有工具栏,没有状态栏,只有一个可以打字的纯白色空间。粗体/斜体热键有效。

我使用lighttpd 来提供tinymce 的javascript 服务,并使用django 的内置服务器来提供其余服务。

谁能帮助我吗?

编辑: 好的,我不确定具体原因,但原因是 lighttpd 在响应标头中为 .js'es 和 .css'es 发送了不正确的内容类型。通过修改lighttpd配置修复。

I'm trying to use to django-tinymce (http://http://django-tinymce.googlecode.com/ ) app to display a WYSIWYG editor in the django admin.

I downloaded and installed it, downloaded the tinymce itself and put it into /js/tiny_mce, did not change anything in the settings.py and added an HTMLField to my model like so:

class MyModel(models.Model):
  text  = tinymce.models.HTMLField()
  ...

When I add a new entry through the django-admin, the tinyMCE is there, but it's all butchered up - no toolbar, no statusbar, just a plain white space where I can type. Bold/italic hotkeys work.

I use lighttpd to serve tinymce's javascripts and django's builtin server for the rest.

Can anyone help me?

EDIT:
Ok, I'm not sure why exactly, but the cause of this was that lighttpd was sending improper content-types for .js'es and .css'es in response headers. Fixed by modifying lighttpd config.

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

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

发布评论

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

评论(1

强者自强 2024-10-13 11:43:11

造成此问题的原因是 lighttpd 在响应标头中发送了不正确的 .js 和 .css 内容类型。通过修改lighttpd配置修复。

the cause of this was that lighttpd was sending improper content-types for .js'es and .css'es in response headers. Fixed by modifying lighttpd config.

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