-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Bootstrap referencing bad glyphicons path #4950
Comments
On second thought, was there a specific reason why an additional |
Also seeing this when trying to upgrade from 3.5.4 to 3.6.1 |
@MichaelPalmer1 - Not particularly intentional, other then ensuring that work on the API docs didn't run the risk of altering anything in the browsable API. Turns out there's no diff between them, so could remove that and use the existing one. |
+1 on seeing this when upgrading from 3.5.4 to 3.6.0+3.6.1 |
Seeing this problem again using 3.7.4 with whitenoise 3.3.1 |
Referenced in #5692 for 3.7.4 |
saw this today when I upgraded django from 4.0.6 to 4.1 |
I can confirm this. Downgrading from 4.1 to 4.0.7 resolved the issue. |
Experiencing this as well using Unsure what the underlying problem is, but a workaround is to ignore DRF on collectstatic like:
Note: you will not be able to use the BrowsableAPIRenderer when DEBUG=False |
Thanks @marcgibbons - I think this is fixed in master with #8591, and should be resolved on our next release. |
Quick & dirty workaround for current Django REST (v.3.13.1) with Django 4.1+:
class WorkaroundFilesStorage(ManifestFilesMixin, StaticFilesStorage):
def post_process(self, *args, **kwargs):
missing_files = {'.../path/to/bootstrap-theme.min.css.map', '.../path/to/bootstrap.min.css.map'}
for missing_file in missing_files:
shutil.copyfile(missing_file, Path(settings.STATIC_ROOT, 'rest_framework', 'css', missing_file.split('/')[-1]).resolve())
return super().post_process(*args, **kwargs)
STATICFILES_STORAGE = 'full.canonical.name.to.WorkaroundFilesStorage' |
Overview
The file rest_framework/static/rest_framework/docs/css/bootstrap.min.css references
../fonts/glyphicons-halflings-regular.eot
. However, the file actually exists at../../fonts/glyphicons-halflings-regular.eot
. This is throwing an error when trying to run collectstatic:Affected Versions
3.6.0+
Suggested Solution
Copy the glyphicons to the appropriate directory.
Similar Issues
#4914
#2008
Checklist
master
branch of Django REST framework.The text was updated successfully, but these errors were encountered: