Pregunta

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

¿Fue útil?

Solución

By using this this syntax,it will work:

"{% static 'theme/one page base/bgimages/' %}/"+num+".jpg"
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top