Pierre-Sassoulas / django-survey

A django survey app that can export results as CSV or PDF using your native language.
GNU Affero General Public License v3.0
217 stars 145 forks source link

Collectstatic fail whitenoise #95

Closed BartKalkman closed 2 years ago

BartKalkman commented 4 years ago

Hi, When using whitenoise the collect static command fails on the following: The CSS file 'survey\css\bootstrap.min.css' references a file which could not be found: survey/fonts/glyphicons-halflings-regular.eot

Pierre-Sassoulas commented 4 years ago

Thank you for the report, this might be something that fix itself if we upgrade bootstrap to the latest version, but I'll merge a fix on the current version too.

CaduceusInc commented 3 years ago

Hello, @BartKalkman were you able to get this working? I have the same error.

@Pierre-Sassoulas were you able to fix this?

Pierre-Sassoulas commented 3 years ago

Hello @CaduceusInc , I'm not working on this project directly right now, I'm only reviewing and merging fixes.

BartKalkman commented 3 years ago

I ended up not using this package in the end because of change in requirements.

zehengl commented 2 years ago

Setting STATICFILES_STORAGE = "whitenoise.storage.CompressedStaticFilesStorage" seems to work for me. Not ideal, but it works. See http://whitenoise.evans.io/en/stable/django.html#add-compression-and-caching-support

Pierre-Sassoulas commented 2 years ago

Thank you for the solution @zehengl, I'm going to close as it seems to be an issue with whitenoise and not django-survey-and-report.

VenturaFranklin commented 2 years ago

@Pierre-Sassoulas This does seem to be an issue with django-survey-and-report. Specifically the file at: https://github.com/Pierre-Sassoulas/django-survey/blob/main/survey/static/survey/css/bootstrap.min.css references files that do not exist at https://github.com/Pierre-Sassoulas/django-survey/tree/main/survey/static/survey/fonts

The folder should have these files: https://github.com/twbs/bootstrap/tree/v3.1.1/dist/fonts

I was able to fix this by going to site-packages/survey/static/survey/fonts And then

wget https://github.com/twbs/bootstrap/blob/v3.1.1/dist/fonts/glyphicons-halflings-regular.eot
wget https://github.com/twbs/bootstrap/blob/v3.1.1/dist/fonts/glyphicons-halflings-regular.svg

And then python manage.py collectstatic works as expected

You are right, it does look like latest versions of bootstrap remove references to a separate fonts folder and files. But right now the fonts files are needed to work.

Pierre-Sassoulas commented 2 years ago

Thank you for the analysis, would you mind adding these files in a merge request @VenturaFranklin ?