I am using django and python. In the template file, I have a drop-down list which is shown as below. It works. The only problem is that there is a lot of white space between in the source html code. Is there any way to remove the white space? Thanks.
{% for lang_ele in video.languages.all %}
{% ifequal lang_ele.lang display_language %}
{% for key, value in language_table.items %}
{% ifequal lang_ele.lang key%}
<option selected = "selected" value={{lang_ele.lang}}>{{value}}</option>
{% endifequal %}
{% endfor %}
{% else %}
{% for key, value in language_table.items %}
{% ifequal lang_ele.lang key%}
<option value={{lang_ele.lang}}>{{value}}</option>
{% endifequal %}
{% endfor %}
{% endifequal %}
{% endfor %}
The output html souce code looks like this:
<option value=de>German</option>
<option value=el>Greek</option>
<option value=hi>Hindi</option>
You can use the
spacelesstemplate tag. It: