Domanda

I want to access the images in the static folder the image name is coming dynamically.

I am using this syntax:

"{% static 'theme/one page base/bgimages/"+num+".jpg' %}"

where num is a random number calculated at runtime using javascript. but it is not working

È stato utile?

Soluzione

By using this this syntax,it will work:

"{% static 'theme/one page base/bgimages/' %}/"+num+".jpg"
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top