Closed danstreeter closed 4 years ago
as you mentioned this is related to comments in jquery css files and thanks for the one-liner. It will be good to refer your one-liner in README. For the people who is facing the same issue (and not using Dockerfile) after installing django-adminlte3 run above command without RUN at the beginning. Like this :
cd $(pip show django-adminlte3 | grep Location | cut -d" " -f2)/adminlte3/static/admin-lte/plugins/jquery-ui && for f in *.css; do echo "Removing offending comments from $f"; sed '/To view and modify this theme/d' $f > $f.2; done && for f in *.css.2; do mv "$f" "${f%.*}"; done
No problem at all. The command that the Dockerfile is running may not be fully supported on the environments the users are using, as the Dockerfile will be running in a known and controlled linux environment with all of the binaries required; and not on the host.
Those on OSX would have differing, potentially failure results because of the binaries used on that command and the parameters it requires, cut
parameters differs from Linux to OSX for example.
Those on Windows wont have a hope of it working. (Not even tried as I dont have a Windows machine to test with)
Ok I removed the comments with bf7bcca0aeb67070c873858d936f74485cb5ebe7 pypi version 0.1.6 with every adminlte.io update, this should be checked.
The collectstatic command fails to process when you are using
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'
within your project.This is because jquery-ui css files contain comments which have paths in them that match the collectstatic regex parsing.
A similar issue has been documented here: https://github.com/django-helpdesk/django-helpdesk/issues/479
As I am using this package within a Docker container and have control over my build process, I have implemented the following workaround within my Dockerfile build process just before the build does the collectstatic command:
Not sure how else to get around it given that the jQuery files will be brought in from somewhere else and there isn't really any control over it - but this has fit my use case and my build process is now able to 'collectstatic' as needed without any issues.