small problem with django-tinymce and django-filebrowser integration

白昼怎懂夜的黑 提交于 2020-01-05 04:38:13

问题


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

  • manage.py test filebrowser, works ok
  • http://localhost:8000/admin/filebrowser/browse/ works, too

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

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

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

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: 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',
)

回答1:


I finally managed to find the answer to my problem.

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

I found the answer in this post: http://www.mail-archive.com/django-users@googlegroups.com/msg100388.html



来源:https://stackoverflow.com/questions/7539957/small-problem-with-django-tinymce-and-django-filebrowser-integration

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!