Reputation: 49
This is html
line which throws an error in VScode
:
style="{% static 'background-image:url(images/home_slider.jpg)' %}"
Upvotes: 1
Views: 117
Reputation: 477607
The {% static … %}
template tag [Django-doc] will only translate the parameter to a URI. It does not know in what "context" it is working. If you want to pass a static image in the url(..)
of style fragment, you can do this with:
style="background-image:url({% static 'images/home_slider.jpg' %})"
Upvotes: 1