Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use staticfiles_storage to generate static files urls for widgets. #51

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

n6g7
Copy link

@n6g7 n6g7 commented Oct 4, 2015

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
Copy link
Author

n6g7 commented Oct 18, 2015

@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 ?

@glynjackson
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants