You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're using the plugin django-ckeditor to add a wysiwyg editor to our models. The package fails to load its static files when used together with django-s3-storage, because of a lost slash when constructing the URL that ends up looking something like this:
On Mon, 27 May 2019 at 11:58, Anders Lisspers ***@***.***> wrote:
We're using the plugin *django-ckeditor* to add a wysiwyg editor to our
models. The package fails to load its static files when used together with
*django-s3-storage*, because of a lost slash when constructing the URL
that ends up looking something like this:
https://[my-bucket].s3.eu-central-1.amazonaws.com/ckeditor/ckeditorconfig.js?
while it's supposed to look like this:
https://[my-bucket].s3.eu-central-1.amazonaws.com/ckeditor/ckeditor/config.js?
(notice the missing slash before config.js)
This happens because django-ckeditor calls url() with the name
'ckeditor/ckeditor/', and somewhere along the way this trailing slash is
removed.
I've drilled it down to being the _get_key_name that strips the trailing
slash.
https://github.com/etianen/django-s3-storage/blob/2748957667b84f4416a5c5c174887700fd2c7a65/django_s3_storage/storage.py#L205-L208
It's using posix.normpath which by design strips trailing slashes.
A proposed solution would be to readd the trailing slash after running
normpath (much like the PR in the "sister package" *django-storage*
<https://bitbucket.org/david/django-storages/pull-requests/72/for-the-s3-and-s3boto-backends-the-url/diff>
)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#86?email_source=notifications&email_token=AABEKCGPU6CXTZIQ7M7KR6TPXO5EVA5CNFSM4HP22XQ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GWABPPA>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABEKCBIR36IYX4NSQH7H23PXO5EVANCNFSM4HP22XQQ>
.
We're using the plugin django-ckeditor to add a wysiwyg editor to our models. The package fails to load its static files when used together with django-s3-storage, because of a lost slash when constructing the URL that ends up looking something like this:
while it's supposed to look like this:
(notice the missing slash before config.js)
This happens because django-ckeditor calls
url()
with the name'ckeditor/ckeditor/'
, and somewhere along the way this trailing slash is removed.I've drilled it down to being the
_get_key_name
that strips the trailing slash.django-s3-storage/django_s3_storage/storage.py
Lines 205 to 208 in 2748957
It's using posix.normpath which by design strips trailing slashes.
A proposed solution would be to readd the trailing slash after running normpath (much like the PR in the "sister package" django-storage)
The text was updated successfully, but these errors were encountered: