django_markdown icon indicating copy to clipboard operation
django_markdown copied to clipboard

Use staticfiles_storage to generate static files urls for widgets.

Open n6g7 opened this issue 10 years ago • 2 comments

Hi,

Currently the urls for the widgets assets aren't processed by the project's defined static file storage (STATICFILES_STORAGE in the settings) and so, when using a custom static file storage (like django-s3-storage), the generated urls results in 404.

I sent these file paths through django.contrib.staticfiles.storage.staticfiles_storage.url to address this issue.

This fixed a bug I had where the assets for the admin widget would point to /admin/app/model/id/django_markdown/... instead of https://s3-eu-west-1.amazonaws.com/bucket/static/django_markdown/... (I use S3 storage) and thus the widget would render as a simple textarea.

n6g7 avatar Oct 04 '15 20:10 n6g7

@klen any thoughts on this pr ?

Also, I don't really know why Travis crashes during the coverage test (https://travis-ci.org/klen/django_markdown/jobs/86011076), any idea ?

n6g7 avatar Oct 18 '15 10:10 n6g7

Same problem here I ended up creating my own AdminMarkdownWidget with support for django-storages and extending the package class.

glynjackson avatar Nov 24 '15 16:11 glynjackson