1π
β
Itβs failing because you are using double quotes inside double quotes
Here is how it would look without the Django static files declaration
<div class="full-background" style="background-image: url('path/to/file')"></div>
Note the single quotes around the url path
If you want to use Django static files, just use single quotes outside and inside the static declaration
<div
class="full-background"
style="background-image: url('{% static '/img/curved-images/white-curved.jpg' %}')"
></div>
Django will not see the outside single quotes when it looks for the static files.
π€ja408
Source:stackexchange.com