I think this variable should not be used directly. Instead we should use the static helper instead. Quoting a StackOverflow answer:
Since this is the top result on Google, I thought I'd add another way to do this. Personally I prefer this one, since it leaves the implementation to the Django framework.
from django.contrib.staticfiles.templatetags.staticfiles import static
url = static('x.jpg')
# url now contains '/static/x.jpg', assuming a static path of '/static/'
I'm recommending this approach since it will correctly renames x.png to x.f0de3f9.png when needed for cache busting.
No need @OmarIthawi, and thanks for your suggestion. Please find your comment addressed in #2.
If you have any other comments please feel free to write them. 😄
Thank you @ahmedaljazzar for creating the library!
In the
README.md
file this library recommends the following:Which has been added with in
djangomako/backends.py
:I think this variable should not be used directly. Instead we should use the
static
helper instead. Quoting a StackOverflow answer:I'm recommending this approach since it will correctly renames
x.png
tox.f0de3f9.png
when needed for cache busting.Let me know if I should clarify more!