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

有帮助吗?

解决方案

By using this this syntax,it will work:

"{% static 'theme/one page base/bgimages/' %}/"+num+".jpg"
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top