Well, what do you know? I figured it out.
The problem was – and, as the django-ckeditor
documentation clearly states, the default urlpattern
entries (in the include
file) specify a "staff-only" decorator for uploads. So, ckeditor
was getting an error-message response ... unless, of course, you were a staff
-member, and of course it didn't know what to do.
To solve the problem:
First, of course, be sure that ckeditor_uploader
(as well as ckeditor
) is installed in your virtualenv, and that it is in your INSTALLED_APPS
list in settings.py
.
Now, in your urls.py
, first add this line near the top:
from ckeditor_uploader import views as uploader_views
Next, insert the urlpattern
entries that you find in the package's urls.py
file, but referencing the uploader_views
alias, viz:
url(r'^ckeditor/upload/',
uploader_views.upload, name='ckeditor_upload'),
url(r'^ckeditor/browse/',
never_cache(uploader_views.browse), name='ckeditor_browse'),
FYI: If you erroneously attempt to specify ckeditor_uploader.views.
in the url()
entry, you will be rewarded with:
NameError: name 'ckeditor_uploader' is not defined
Now you know! :-)