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

Better support for static files of plugins #111

Closed
dyve opened this issue Aug 13, 2015 · 1 comment
Closed

Better support for static files of plugins #111

dyve opened this issue Aug 13, 2015 · 1 comment

Comments

@dyve
Copy link
Contributor

dyve commented Aug 13, 2015

Thanks for a great app!

In leaflet/__init__.py, this statement:

urls[i] = urljoin(settings.STATIC_URL, url)

does not take the settings for Django's static files backend into account. This means md5 hashes, S3 storage, etc. will all cause the plugins to fail.

A solution would be to have Django static files generate the url, and replace the code above with:

from django.contrib.staticfiles.templatetags.staticfiles import static
urls[i] = static(url)

See also: http://stackoverflow.com/questions/11721818/django-get-the-static-files-url-in-view

I could do a pull request, but since it's only one line I figured this was the fastest solution with a proper explanation of the problem. I hope you can use this.

@leplatrem
Copy link
Collaborator

Thanks @dyve for the compliments !

This looks like a very relevant point !

Could you please a pull-request instead ? Add your name to contributors and changelog ?
It would be a lot less effort to integrate your fix :)


We would welcome any help for maintaining this library. If you use it and find it useful, please Watch it on Github, help us review contributions or comment issues :) Thousand thanks in advance.

leplatrem added a commit that referenced this issue Sep 7, 2015
Pass relative URLs for static files through django.contrib.staticfiles (fixes #111)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants