Nanor
Nanor

Reputation: 2560

How can I specify where ckeditor.js is located?

I'm trying to integrate django-ckeditor into my admin forms. I've followed the required documentation but whenever I want to add a new blog post through my CMS the following error occurs:

[01/Aug/2013 14:21:34] "GET /admin/RehabLog/post/add/ HTTP/1.1" 200 8608

[01/Aug/2013 14:21:34] "GET /admin/RehabLog/post/add/static/static/ckeditor/ckeditor/ckeditor.js HTTP/1.1" 301 0

[01/Aug/2013 14:21:34] "GET /admin/jsi18n/ HTTP/1.1" 200 5169

[01/Aug/2013 14:21:34] "GET /admin/RehabLog/post/add/static/static/ckeditor/ckeditor/ckeditor.js/ HTTP/1.1" 404 1800

Now ckeditor.js isn't there which leads me to two questions: Where is ckeditor.js and how can I tell django where it is?

As requested here are my some settings:

MEDIA_URL = '//s3.amazonaws.com/%s/media/' % AWS_STORAGE_BUCKET_NAME
MEDIA_ROOT = '/%s/' % DEFAULT_S3_PATH
STATIC_ROOT = os.path.join(basepath, 'staticfiles')
STATIC_URL = 'static/'

Upvotes: 2

Views: 760

Answers (2)

oleq
oleq

Reputation: 15895

You may need to set CKEDITOR_BASEPATH variable in order to have the library working correctly.

Upvotes: 1

Aleister
Aleister

Reputation: 153

You must have a directory in your application that serves staticfiles. That is where you should put the ckeditor.js. Normally the folder is in root of project and is called static

It has to be the same folder referred to in the settings file as STATIC_ROOT or listed in STATICFILES_DIRS. This way you'll just add {{STATIC_ROOT}}ckeditor.js to the template to have it served in the html

Upvotes: 0

Related Questions