Closed jeanlucmongrain closed 7 years ago
I found it, it is caused when you first have this:
{% staticfile "abc.js" %}
and replace it after template had been rendered by:
{% slimfile "abc.js" %}
fix:
https://github.com/bclermont/django-static/commit/fb21cb00b167cb7d5ee1d70e8e6229e356639638
I have set my deployment this way: the code is in /usr/local/src/$project. Gunicorn is running under a non-root user. the path are set that the source where django-static get it's static file is in a different directory than slimmed, compiled or simply symlinked file.
It can only create new content and never write original files.
But, I have this weird behavior I've seed 5-6 times, where django-static try to open a symlink as a regular file and write data into it.
It might be caused by some manipulation I made. Sometimes I replace:
by:
so I get unmodified .js and can troubleshoot javascript errors easily.
when the problem happens this is raised exception:
the symlink point to elsewhere and is not writable by gunicorn user