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

collectstatic can't find glyphicons when using ManifestStaticFilesStorage #2008

Closed
defrex opened this issue Nov 2, 2014 · 4 comments
Closed
Milestone

Comments

@defrex
Copy link
Contributor

defrex commented Nov 2, 2014

With the latest 3.0 (https://github.com/tomchristie/django-rest-framework/archive/version-3.0.zip), I got the following when I collectstatic:

ValueError: The file 'rest_framework/fonts/glyphicons-halflings-regular.eot' could not be found with <django.contrib.staticfiles.storage.ManifestStaticFilesStorage object at 0x7f5955ef7f28>.

Django 1.7 comes with ManifestStaticFilesStorage, a staticfiles storage backend that puts a hash of the file in the filename when you run collectstatic. As part of this process, it introspects CSS files no modify any external files references. For that reason, every @import needs to be a files Django's collectstatic can access. I believe that is the problem here.

@tomchristie
Copy link
Member

The text or filename 'glyphicons-halflings-regular.eot' is not referenced anywhere inside REST framework. At the moment I'm going to assume that was a temporary issue while the bootstrap 3 integration was midway through, but feel free to reopen this issue if still replicating for you, along with any description of what you think is required to rectify the issue.

@defrex
Copy link
Contributor Author

defrex commented Nov 5, 2014

The following is in bootstrap.min.css. This is what's triggering ManifestStaticFilesStorage to look for the file.

@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}

The solution is to include the fonts/ directory that comes packed with bootstrap under static/rest_framework/. As a bonus, this will make the vector-based Glyphicons work.

Alternately, use a version of bootstrap that discludes the font-based version of Glyphicons. This can be generated pretty easily at http://getbootstrap.com/customize/.

Thanks for the amazing framework BTW. I'm really excited for 3.0.

@tomchristie
Copy link
Member

Not sure which of those those options we ought to be going for. Assuming we're not actually using the glyphicons at the moment or assume we'd have seen that they're broken. Might be best to simply include them tho, on the basis of easier reuse, theming etc.

@tomchristie tomchristie reopened this Nov 5, 2014
@tomchristie tomchristie added this to the 3.0 Release milestone Nov 5, 2014
@tomchristie
Copy link
Member

Closed by #2024.

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

No branches or pull requests

2 participants