I have javascript that is running on a django app. I get a list from my views.py and after that I want to get the img url
The first line of code gets it and console log shows exactly what I want pictures/logo.png
The problem is that in the third line of code the variable img
shows me this: %22%2bimg%2b%22
Can you see what I'm missing?
img = data[i].fields.imagen.substring(13);
console.log(img);
html += "<div class='brick "+size+"' style='background-image: url(\"{% static '"+img+"' %}\")'><div class='cover'>"+nombre+"</div></div>"