Including variables in static


I would like to use a variable name containing a path rather than the path string itself in the format below. For example:
This is the usual method
“{% static “imagesfolder/img1.jpg” %}”

However, I have a variable mypath defined as
mypath = “imagesfolder/img1.jpg”
and would like to include mypath in the above format instead of the path string itself.

Could anyone help me out with this ?

Thank you

First you need to pass the variable to the template when rendering as context. Then using {% static mypath %} should work.

Thank you…will work on that