django-cms_text_ckeditor error of static loading with Amazon S3 static storage

493 Views Asked by At

After deploying django + django-cms project on server using amazon S3 (STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' ), static files not loading for django-cms_text_ckeditor, bundle of ckeditor is trying to load static from local storage and it's doesn't working, obviously. All other static files is loading from s3 bucket without any problems. On localhost ckeditor bundle is requesting to local static, and it's work, other static files loading from s3 bucket. Maybe somebody have an idea how to make bundle load static with s3, or just take files from project server(like a localhost behavior)? This plugin used only in admin, so it's not critical to load server static with it.

Doesn't working with ckeditor default settings, as with custom setting and loaded bundle from ckeditor official site.

Google of it, obviously, wasn't successfull, although i spent a lot of time on it.

Django==1.11.13 django-cms_text_ckeditor==3.6.0

Loading failed for the <script> with source “http://myproject.herokuapp.com/static/cms_modules/ckeditor/config.js?t=G87E”. config:1
Loading failed for the <script> with source “http://myproject.herokuapp.com/static/cms_modules/ckeditor/skins/moonocolor/skin.js?t=G87E”. config:1
Loading failed for the <script> with source “http://myproject.herokuapp.com/static/cms_modules/ckeditor/lang/en.js?t=G87E”. config:1
TypeError: c[a] is undefined

1

There are 1 best solutions below

0
On

If somebody interested in, solved it by this:

AWS_STORAGE_BUCKET_NAME = os.environ.get('AWS_STORAGE_BUCKET_NAME', 'example-app')
AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % AWS_STORAGE_BUCKET_NAME
TEXT_CKEDITOR_BASE_PATH = 'https://%s/djangocms_text_ckeditor/ckeditor/' % AWS_S3_CUSTOM_DOMAIN