small problem with django-tinymce and django-filebrowser integration
I am trying to integrate django-tinymce with django-filebrowser for my django admin site. Everything (almost) works fine.
manage.py test filebrowser
, works okhttp://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 win开发者_运维技巧dow 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',
)
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
精彩评论