0👍
I believe
('text/less', 'lessc {infile} {outfile}'),
should be
('text/less', 'lessc {infile} > {outfile}'),
as without the redirect lessc will compile to stdout.
0👍
This may or may not apply to the original poster, but I experienced the exact same error (.less files getting linked instead of being replaced by the generated CSS) and it was because I had recently set Django to run as a normal user instead of root, and hence didn’t have permission to write to the cache folder that it created as root. chown -R myuser:mygroup static/cache
solved the problem.
- [Django]-How to train a Keras model in Django: weak reference to 'gevent._local.local' object error
- [Django]-Django can't process non-ascii symbols
- [Django]-Adding new form fields dynamically in admin
0👍
I’m having a similar issue, my setup is nearly identical to yours (using apache, debug=False, etc.), and haven’t resolved it yet. I have found that if I manually run compress (python manage.py compress), it will resolve the issue, but it will only resolve it temporarily. After 6-12 hours the issue will recur.
There is nothing dynamic in the .css/.js files that I’m compressing – I’m using django compressor as a means of precompiling my lessc and coffeescript.
I hope you found a workaround last fall when you ran into this issue – for anyone else having the same problem, try manually running compress. I don’t know why this helps, since the files are already there in the CACHE, but for some reason it does (temporarily). I’ll update when I resolve.
EDIT: Problem has not recurred in the past 12 days. I’m still a little sketched out that there was a problem and I didn’t understand the resolution, but for now it’s working so I’m focusing on other stuff. If you have an issue of this nature, please post or comment.
Recommended steps if you have this issue:
- Verify that the files are generated in the CACHE directory
- Look at ownership of the files, and the CACHE directories, and chown them if necessary
- Look at timestamps of the files in CACHE, verify that they’re reasonable
- Run collectstatic and compress manually, then restart the server (kill & restart if you’re using python runserver, or sudo service
apache2 restart, or other equivalent)