I just changed my storage server to Amazon S3 and I realized that my background is not loading for my site. I looked and realized that in my CSS (actually SASS) I specified the background URL ( static/mysite/images/background.gif ).
I am wondering how I should fix this problem. Of course, I could just change it to a new static URL, but that seems like bad practice. So I tried loading my background image from {{ STATIC_URL }} into my body HTML, but then it first displays my background before repeat: no-repeat; will display my actual CSS, making the background repeat across the screen while loading CSS. In any case, I do not like to mix my styles in the document.
So what is the best way to provide a relative path for a background image in Django? Should I customize my CSS as a template and direct it through the view? It also seems dirty.
Or should I just forget about making static_url agnostic and just write the code in my CSS?
source share