本文介绍了django-tinymce和django-filebrowser集成的小问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的django-tinymce与django-filebrowser集成django管理网站.一切(几乎)一切正常.

I am trying to integrate django-tinymce with django-filebrowser for mydjango admin site.Everything (almost) works fine.

  • manage.py test filebrowser,可以正常工作
  • http://localhost:8000/admin/filebrowser/browse/也有效
  • manage.py test filebrowser, works ok
  • http://localhost:8000/admin/filebrowser/browse/ works, too

但是,当我按下Windows弹出窗口上的browse按钮时tinymce按钮面板的insert/edit image没有任何反应.

however when I press the browse button on the windows popup ofinsert/edit image of tinymce button panel nothing happens.

在我的firefox调试窗口中,出现这样的错误(按browse时):

in my firefox debug window I get an error like this (when pressing browse):

f is undefined
code: http://localhost:8000/static/js/tiny_mce/tiny_mce_src.js
line: 11981

在我的dev-server输出窗口上,出现500错误,如下所示:

and on my dev-server output window I get a 500 error like this:

GET /tinymce/filebrowser/ HTTP/1.1" 500,当管理页面尝试加载tinymce_models.HTMLField()文本区域时.

GET /tinymce/filebrowser/ HTTP/1.1" 500 when admin page tries to load the tinymce_models.HTMLField() text area.

任何想法我在做什么错?

Any ideas what am I doing wrong?

PS:我也使用grappelli,这是我的settings.py部分,用于加载应用程序:

PS: I also use grappelli and this is my settings.py part that loads the apps:

INSTALLED_APPS = (
#... usual django standard apps.. #
    'django.contrib.staticfiles',
    'grappelli',
    'filebrowser',
    'tinymce',
    'django.contrib.admin',
    'expedeat.dbadmin',
)

推荐答案

我终于设法找到问题的答案.

I finally managed to find the answer to my problem.

我不得不像这样修改tinymce/views.py文件:

I had to modify the tinymce/views.py file like this:

fb_url = "%s://%s%s" % (request.is_secure() and 'https' or 'http',
    #request.get_host(), urlresolvers.reverse('filebrowser-index'))
    request.get_host(), urlresolvers.reverse('fb_browse'))

我在这篇文章中找到了答案: http://www.mail-archive.com/django-users @ googlegroups.com/msg100388.html

I found the answer in this post:http://www.mail-archive.com/[email protected]/msg100388.html

这篇关于django-tinymce和django-filebrowser集成的小问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 22:18