Currently, I am transferring all links to static files in my project to the new tag {% static%} introduced by django 1.5, but I have a problem, in some places I use variables to get content. With the new tag I canβt, is there any way to solve this?
Current Code:
<img src="{{ STATIC_URL }}/assets/flags/{{ request.LANGUAGE_CODE }}.gif" alt="{% trans 'Language' %}" title="{% trans 'Language' %}" />
What it should be (this does not work):
<img src="{% static 'assets/flags/{{ request.LANGUAGE_CODE }}.gif' %}" alt="{% trans 'Language' %}" title="{% trans 'Language' %}" />
django django-templates django-staticfiles
Oscar Carballal May 20 '13 at 18:24 2013-05-20 18:24
source share